自定義的數組排序

   
    NSSortDescriptor *sortDescriptor = [[NSSortDescriptor alloc] initWithKey:@"typeDict.pos" ascending:YES];
   
    NSArray *sortDescriptors = [NSArray arrayWithObject:sortDescriptor];
   
    [arr sortUsingDescriptors:sortDescriptors];
   
    [sortDescriptor release];
    數組

 

 

每一個數組裏放的是AD對象。ad對象有屬性typeDict(字典)字典裏有pos(鍵值)ide

相關文章
相關標籤/搜索