`
lizhuang
  • 浏览: 904248 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

解决 sending 'const NSString *' to parameter of type 'NSString *' discards qualifi

 
阅读更多
比如,写了 const NSString* firstString = @"xxx";
NSString* secondString = @"yyy";
[secondString isEqualToString:firstString];
会出现 sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers 警告。
解决办法:
把 const NSString* firstString = @"xxx";
改成 NSString* const firstString = @"xxx";

解释:前者相当于指针本身不可修改,后者表示指针指向的内容不可修改,两者的作用都是使firstString只可读不可写。
分享到:
评论

相关推荐

    Beginning PHP 5.3

    - **Understanding the Output:** Explanation of how the output is generated and displayed to the user through the web browser. - **Variables and Data Types:** Introduction to ...

    分享在一键boot时出现sending boot FAILED的解决方案

    总的来说,当遇到“sending boot FAILED”的错误时,不要慌张,可以尝试通过甜椒助手这类辅助工具来解决问题。在刷机过程中,理解不同模式(如fastboot、recovery等)的用途以及如何在它们之间切换,是避免常见错误...

    ObjCRuntimeGuide

    - **The objc_msgSend Function:** At the heart of the messaging system is the `objc_msgSend` function, which is responsible for sending messages to objects. This function takes a target object and a ...

    Serial Programming Guide for POSIX Operating Systems

    **Asynchronous communications** involve sending data as individual characters with start and stop bits to synchronize transmission. It does not require a constant clock signal and is more flexible but...

    Bloodshed Dev-C++

    * Added the possibility to modify the value of a variable during debugging (right click on a watch variable and select "Modify value") * During Dev-C++ First Time COnfiguration window, users can now ...

    HTML5 Games

    - **Using Workers**: Practical examples of sending and receiving messages between the main script and a Web Worker. - **Shared Workers**: An introduction to shared workers and their role in sharing ...

    oracle_10g提示java.lang.Exception_Exception_in_sending_Request__null解决方案

    ### Oracle 10g 提示 java.lang.Exception: Exception in sending Request :: null 解决方案 在使用Oracle 10g的过程中,部分用户可能会遇到一个特定的问题:在登录企业管理器(Enterprise Manager, EM)时,系统会...

    Sending the contents of a webpage with images as an HTML mail

    如果有多个收件人,可以使用`To`, `Cc`, `Bcc`属性添加。 7. **处理图像嵌入**:在C#中,可以使用`System.IO`和`System.Net`命名空间来读取文件内容,转换成Base64字符串,或者使用`System.Net.Mail.LinkedResource...

    Java邮件开发Fundamentals of the JavaMail API

    the JavaMail API, if you want this type of information, you have to calculate it yourself. IMAP IMAP is a more advanced protocol for receiving messages. Defined in RFC 2060 , IMAP stands for ...

    解决Sending DHCP and RARP requests .... 卡住问题

    解决 Sending DHCP and RARP requests 卡住问题 Sending DHCP and RARP requests 卡住问题是一个常见的嵌入式系统开发中的问题。该问题的出现是由于在内核配置的时候选择自动配置IP,但是在内核又不能正确的自动...

    Keil.STM32F7xx_DFP.2.12.0.pack(STM32F7xx系列官方固件库驱动库板级支持包for Keil MDK 5)直接运行即可

    Version: 2.12.0 (2019-07-17) Keil.STM32F7xx_DFP....Updated SPI_TRANSFER_INFO structure - tx_buf type changed from uint8_t * to const uint8_t *. Added check for valid pointer to SPI_PIN prior to use.

    尚易代理商技术培训常州中环互联网专业网站建设电子商务.pptx

    1. **SMTP error, RCPT TO: 550**:当收件人地址不存在或被列入黑名单时,邮件会被退回。需通过测试确认问题并解决。 2. **Forgery sender address!**:收件人服务器会验证发件人邮箱的MX记录和发信服务器是否一致...

    解决MySQL Sending data导致查询很慢问题的方法与思路

    MySQL数据库在处理查询时,有时会遇到"Sending data"状态导致查询速度变慢的问题。这种情况通常意味着MySQL正在收集并发送数据给客户端,特别是当查询涉及到大字段如`TEXT`或`VARCHAR(8000)`等时,性能瓶颈可能就在...

    Oracle EBS R12 Order Management_TRAIN

    - **Drop Shipments**: Involves sending orders directly from suppliers to customers, bypassing the company's warehouse. - **Creating Drop Ship Orders**: Requires configuring supplier information and ...

    解决VS2012 Express的There was a problem sending the command to the program问题

    安装Visual Studio 2012 Express之后,双击打开web.config文件时经常出现“There was a problem sending the command to the program”的错误,然后VS2012 Express打开了,但web.config文件没打开,需要再次双击web....

    Objective-C 基础教程

    - **Sending Messages to nil(向nil发送消息)**:讨论了向nil发送消息时的行为以及如何处理这种情况。 - **The Receiver’s Instance Variables(接收者的实例变量)**:介绍了如何访问和修改接收者对象的实例...

    框架集合错误解决方案

    Exceptions sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener org.springframework.beans.factory.BeanCreationException: Error creating...

    This example is a very simple solution to sending and receiv

    This example is a very simple solution to sending and receiving data to and from a Parallax Basic Stamp. This example requires a Basic Stamp and the MSComm control. Also included is an example Basic ...

    数位板压力测试

    The interface should accommodate three kinds of programmers: those who wish to write sim-ple tablet programs, programmers who wish to write complex applications that take full ad¬vantage of tab-let ...

    django-master-class

    Signals in Django are a way to allow certain senders to notify a set of receivers when some action has taken place. They provide a way for decoupled applications to interact with each other. **Key ...

Global site tag (gtag.js) - Google Analytics