티스토리 뷰

    NSDictionary *dic = [NSDictionary dictionaryWithObjectsAndKeys:@"22", @"published",@"33",@"key",nil];
    NSDictionary *dic2 = [NSDictionary dictionaryWithObjectsAndKeys:@"23", @"published",@"34",@"key",nil];
    NSDictionary *dic3 = [NSDictionary dictionaryWithObjectsAndKeys:@"22", @"published",@"35",@"key",nil];
    NSDictionary *dic4 = [NSDictionary dictionaryWithObjectsAndKeys:@"24", @"published",@"36",@"key",nil];
    NSDictionary *dic5 = [NSDictionary dictionaryWithObjectsAndKeys:@"21", @"published",@"37",@"key",nil];
   
    NSMutableArray *array = [NSMutableArray arrayWithCapacity:10];
    [array addObject:dic];
    [array addObject:dic2];
    [array addObject:dic3];
    [array addObject:dic4];
    [array addObject:dic5];
   
    NSSortDescriptor *publishedSorter =     [[[NSSortDescriptor alloc] initWithKey:@"published"
                                                                        ascending:YES                                             
                                                                         selector:@selector(localizedCaseInsensitiveCompare:)] autorelease];
    NSLog(@"%@", [array description]);
    [array sortUsingDescriptors:[NSArray arrayWithObject:publishedSorter]];
   
    NSLog(@"%@", [array description]);

'나름 프로그래밍? > Objective-C' 카테고리의 다른 글

간단하게 URL Request 받기  (0) 2010.10.03
EUC-KR 인코딩  (2) 2010.07.28
UIWebView 의 Delegate(링크 막기)  (0) 2010.05.14
뷰전환시 탭바 감추기  (0) 2010.05.14
libxml 헤더 포함하기  (0) 2010.05.12
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2024/05   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함