您的位置:首页 > 其它

如何防止NSMutableDictionary 或 NSMutableArray 为 nil ,导致数据无法写入~~

2016-05-07 16:38 543 查看
try:
NSMutableArray
*sectionTitles = [[NSMutableArrayalloc] init];[/code]or any of the following:
sectionTitles = [[NSMutableArrayalloc] initWithCapacity:sectionTitles.count];
sectionTitles = [NSMutableArraynew];
sectionTitles = [NSMutableArrayarray];
sectionTitles = [NSMutableArrayarrayWithCapacity:sectionTitles.count];
maybe some silly ones:
sectionTitles = [NSMutableArrayarrayWithArray:@[]];
sectionTitles = [@[] mutableCopy];


                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: