I created was stu1 stu2 stu3 stu4 stu5 in both the student's name and gender math scores put them all in an array
NSArray * array = [[NSArray alloc] initWithObjects: stu1, stu2, stu3, stu4, stu5, nil];
I want to sort the math
How should use the following method was modified ah ah how
NSArray * sortArray = [array sortedArrayUsingSelector: @ selector (compare :)];
Reply:
It is stored in the database, otherwise Gaosi you. .
Reply:
My brother had just one week will not be so advanced OC was ah just learned this method trying to figure out how to use ah
Reply:
Rewrite compare methods stu class
Reply:
Something you can say I'm not very good at detail ah. . . Thank you
Reply:
- (NSComparisonResult) compare: (stu *) other {
if (⋯ ⋯) {
return NSOrderedDescending;
} Else if (⋯ ⋯) {
return NSOrderedAscending;
}
⋯ ⋯
Reply:
Well in fact almost bubble sort, you compare stu.math, then bubbling, you can get
Reply:
iphone technology exchange group, 4,633,616, welcome to explore.
No comments:
Post a Comment