我有鑰匙的NSArray
從NSDictionary
這樣的:如何排序鍵的NSArray?
NSArray *array = [[NSArray alloc] initWithArray:[myDict allKeys]];
[array sortedArrayUsingSelector:@selector(compare:)];
爲什麼不陣列得到命令?
我有鑰匙的NSArray
從NSDictionary
這樣的:如何排序鍵的NSArray?
NSArray *array = [[NSArray alloc] initWithArray:[myDict allKeys]];
[array sortedArrayUsingSelector:@selector(compare:)];
爲什麼不陣列得到命令?
我認爲它有用,你
NSDictionary *stateZip;
NSArray *states;
NSDictionary *dictionary = [[NSDictionary alloc] initWithContentsOfFile:plistPath];
self.stateZip=dictionary;
[dictionary release];
NSArray *component = [self.stateZip allKeys];
NSArray *sorted =[component sortedArrayUsingSelector:@selector(compare:)];
self.states=sorted;
個
ragards, CNSivakUmar
Heyy試試這個....
NSSortDescriptor *lastNameSorter = [[NSSortDescriptor alloc] initWithKey:@"lastName" ascending:YES];
這樣做,我把這個在data.h/M文件作爲NSMutableArray裏與數據或viewcontroller.h/M檔爲我創建需要在表格中顯示數據?
這可能會有所幫助:
NSSortDescriptor *sortDesc = [[NSSortDescriptor alloc] initWithKey:@」self」 ascending:YES];
[array sortUsingDescriptors:[NSArray arrayWithObject:sortDesc]];
[sortDesc release];
欲瞭解更多信息,看看
不工作... [__NSArrayI sortUsingDescriptors:]:無法識別的選擇發送到實例0x6a58bc0 – 2011-02-28 12:55:11
完美!我是個假人! – 2011-02-28 13:01:05
沒有人...每個人都有同樣的 - 平等..不要這樣說.. – CNSivakumar 2011-02-28 13:39:04