Mob*_*oid 97

你可以这样做来排序NSMutableArray:

[yourArray sortUsingSelector:@selector(localizedCaseInsensitiveCompare:)];
Run Code Online (Sandbox Code Playgroud)


JP *_*sek 47

这里提到的其他答案提到使用@selector(localizedCaseInsensitiveCompare :)
这适用于NSString数组,但是OP评论说该数组包含对象,并且应该根据object.name属性进行排序.
在这种情况下,你应该这样做:

NSSortDescriptor *sort = [NSSortDescriptor sortDescriptorWithKey:@"name" ascending:YES];
[yourArray sortUsingDescriptors:[NSArray arrayWithObject:sort]];
Run Code Online (Sandbox Code Playgroud)

您的对象将根据这些对象的name属性进行排序.