iOS9 new Features

Source: Internet
Author: User

Ns_assume_nonnull_begin

Ns_assume_nonnull_end

A property assignment must not be null between these two

Null_resettable allow set to be empty get not empty requires overriding set method

@property (null_resettable,strong,nonatomic) nsmutablearray * ALLDETAILDATA;
@property (null_resettable,strong,nonatomic) nsmutablearray * ALLDETAILDATA;

Nonnull property assignment can not be null to the opposite nullable can be
@property (nonnull,strong,nonatomic) nsmutablearray * ALLDETAILDATA;

Generic type
You can set the properties of an object by setting data assignments in some collections

The benefit of the @property (strong,nonatomic) nsarray<nsstring*>*explainarray;//warning only for strings is that the array can be directly obtained when the data is obtained

@property (Nonatomic,strong) nsdictionary<nsstring*,nsnumber*> *dic; key is the string value is number

Custom generics

#import <Foundation/Foundation.h>

@interface Car<objecttype>: nsobject
-(void) Add: (ObjectType) name;
@end

__covariant small type turn large type

__contravariant big change Small No warning

__kindof

__kindof tells the compiler that it can be a nsstring or a subclass of NSString
-(__kindof nsstring*) text;

Native Example (TableView remove a cell)

-(Nullable __kindof UITableViewCell *) Cellforrowatindexpath: (Nsindexpath *) Indexpath; Returns nil if cell is no visible or index path is out of range

[TableView Cellforrowatindexpath:[nsindexpath indexpathforitem:0 insection:0];

iOS9 new Features

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.