mutArray = [[NSArray alloc]initWithObjects:@"Titanic",@"Batman",@"Spiderman",@"Avatar",@"Pirates ofcarrrabiean",@"Avengers",@"Harrypotter",@"starwars",@"Lordofrings", nil];
答案 0 :(得分:0)
试试这个。
NSSortDescriptor *descriptor=[[NSSortDescriptor alloc] initWithKey:@"self" ascending:NO];
NSArray *descriptors=[NSArray arrayWithObject: descriptor];
NSArray *shortedArray=[mutArray sortedArrayUsingDescriptors:descriptors];