`
aitracy
  • 浏览: 71485 次
  • 性别: Icon_minigender_1
  • 来自: 无锡
社区版块
存档分类
最新评论

NSArray转为NSMutableArray

 
阅读更多
NSDictionary *names;
NSMutableArray *keys;  


NSString *path = [[NSBundle mainBundle] pathForResource:@"sortednames" ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
names = dict;
   
NSMutableArray *array;
[array setArray:[[names allKeys] sortedArrayUsingSelector:@selector(compare:)]];
self.keys = array;
 

 

參考:

 

setArray:
Sets the receiver’s elements to those in another given array.

- (void)setArray:(NSArray *)otherArray

Parameters
otherArray
The array of objects with which to replace the receiver's content.


分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics