//類工廠方法
NSMutableArray*array = [NSMutableArrayarray] ;
NSMutableArray*a2 = [NSMutableArrayarrayWithObjects:@”look”,nil] ;

//添加元素
[arrayaddObject:@”hehedda”] ;
[a2addObject:@”gagag”] ;
//刪除全部元素
[a2removeAllObjects] ;
//刪除指定元素
[a2removeObjectAtIndex:1] ;

//能創建,但是無法調用 NSMutableArray 的任何方法
NSMutableArray*na =@[@”hehe”,@”rose”];
//返回一個NSArray的值

本篇到這裡就差不多了,喜歡的記得點贊轉發(*^__^*) 。
原創文章,作者:投稿專員,如若轉載,請註明出處:https://www.506064.com/zh-hk/n/251193.html