NSSortDescriptor *nameSorter = [[NSSortDescriptor alloc] initWithKey:NAME_KEY ascending:YES selector:@selector(caseInsensitiveCompare:)];
[drinkArray sortUsingDescriptors:[NSArray arrayWithObject:nameSorter]];
[nameSorter release];
// caseInsensitiveCompare 별도로 지정하지 않으면 대소문자를 구별해서 정렬한다.
'Object-C' 카테고리의 다른 글
Memory Management (0) | 2010.11.02 |
---|---|
StanFord Lecture PDF (0) | 2010.10.29 |
키보드 사이즈 이벤트 (0) | 2010.10.23 |
트위터 posting (0) | 2010.10.22 |
valueForKey vs objectForKey (0) | 2010.10.22 |