Processing in IOS development (null) and <null>

Source: Internet
Author: User

Transferred from: http://blog.csdn.net/shenshen123jun/article/details/38315755

Bookmark it for your own convenience.

Accidentally in the development process, got (null) and the return value of <null>, looked for a long time only found a about <null>.

Because it is necessary to determine the response based on the return value, you must know the specific character that the return value represents, and when you get (NULL) Take advantage of isequal: and @ "", null,@ "(null)", Nil,nil not get the correct result after comparison, But still feel like nil, forced to create a string, assignment to nil, printout, sure enough is (null), what is not the reason for the difference. Finally tried "= =", success. After a struggle to understand the original to use:

if (M_result==nil)

{

NSLog (@ "kda!");

}

There is <null>, from the Internet to find the usage:

if ([M_result isequal:[nsnull null]])

{

NSLog (@ "kda!");

}

The problem is simple, can not find the reason to solve the difficult, not by sigh, the basis of the most important AH.

Write down, hope can help others a little bit is enough.

Processing in IOS development (null) and <null>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.