IOS-Setting up a system similar way to discard warnings

Source: Internet
Author: User

During the development process, when invoking a system method, you can often see that the method has been deprecated, such as:

Feel particularly dazzling, check the information, if you want to achieve the following results, only need to use the system of the following several keywords added to the method name after it can be:

Ns_deprecated_ios (2_0, 7_0, "USE-TURNNILTOSTR:") __tvos_prohibited;

The implementation uses the following methods:

If there's a way

-(NSString *) Judenilstr: (NSString *) STR is used to determine if the string is nil, and if nil it returns @ ""; but now this method does not want to use, want to use

-(NSString *) Turnniltostr: (NSString *) str this method;

Then the implementation method is as follows:

-(NSString *) Judenilstr: (NSString *) str ns_deprecated_ios (2_0, 7_0, "USE-TURNNILTOSTR:") __tvos_prohibited;-( NSString *) Turnniltostr: (NSString *) str;

Among them, Ns_deprecated_ios (2_0, 7_0, "USE-TURNNILTOSTR:") __tvos_prohibited in the "User xxxxxx" of the XXXX represents the new method name.

It is important to note that the keywords are written in front of the ";" and no one works.

To try it, very interesting, occasionally installed force, why not?

IOS-Setting up a system similar way to discard warnings

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.