开发者

Sorting NSMutableArray with NSStrings in alphabetical order

I have a NSMutableArray with NSStrings and I want t开发者_StackOverflow社区o sort them in alphabetical order, seems it's no hard, but I didn't find nice solution. Help me please.


Using sortUsingSelector: method with compare: as comparing selector:

NSMutableArray* strings = [NSMutableArray arrayWithObjects:@"dog", @"ant", @"cat",nil];
[strings sortUsingSelector:@selector(compare:)];
NSLog(@"%@", strings);
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜