Common keywords for new features of IOS9

Source: Internet
Author: User

IOS9 new feature Keywords: can be used in properties, method return values, and parameters

The role of the keyword: prompt action, tell the developer property information

The purpose of the keyword: to cater to Swift,swift is a strong language, Swift must specify whether an object is empty

Keyword Benefits: Improve code planning and reduce communication costs

Keyword usage errors only report a warning and do not compile the error

Nullable:1. How to use (syntax) 2. When to use (function)

The role of nullable: May be empty

Nullable Syntax 1

@property (Nonatomic, strong nullable) NSString *name;

Nullable Syntax 2 * keyword variable name

@property (nonatomic, Strong) NSString * _nullable name;

Nullable Syntax 3

@propert (Noantomic, strong) NSString *_nullable name;

Nonnull cannot be empty;

Null_resettable:1. How to use (syntax) 2. When to use (function)

You must handle the empty case, overriding the Get method

null_resettable function: The Get method cannot return a nil set method that can be passed in as an empty

null_resettable syntax

@property (Nonatomic, Strong, null_resettable) NSString *name;

Common keywords for new features of IOS9

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.