IOS Notes-Partial problem resolution encountered when applying login

Source: Internet
Author: User

In the registration of the network used by the three-party library is afnetworking, registered with only one account password, but the individual users still have a lot of information is not filled, then I use the account login back before the interface needs to pass the value, the user picture and name, then the program crashes, the error message displayed is

-[nsnull length]: Unrecognized selector sent to instance 0X30ADB48

The reason is that the value returned in the background is a lot of NULL, in OC is the null value of Nsnull, so when assigned, the program crashes.

Workaround:

When assigning a value, add a judgment when the fetch data is not empty and then assign a value, and the null is not assigned.

Determine whether get is empty

if (![ Usernicename Iskindofclass:[nsnull class]) {

Assignment statements

[Self.loglabbtnper settitle:usernicename forstate:uicontrolstatenormal];

}

IOS Notes-Partial problem resolution encountered when applying login

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.