读书人

NSArray转向NSMutableArray

发布时间: 2012-08-25 10:06:20 作者: rapoo

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.


读书人网 >移动开发

热点推荐