2009-09-17 26 views
0

我正在嘗試使用MPMediaItemCollection count屬性對數組中的項進行排序。當我嘗試使用NSUInteger屬性對數組進行排序時,它不起作用。當我嘗試打印它時(NSLog(@"%lx",count);),打印不正確。MPMediaItemCollection Count - NSUInteger

如何讓NSUInteger正常工作?

回答

1

也許這會有所幫助。這工作我使用MPMediaCollection爲:使用

[everything setGroupingType: MPMediaGroupingGenre]; 
NSArray *genreLists = [everything collections]; 

for (MPMediaItemCollection *genreList in genreLists) { 
    NSLog (@"count: %d", [genreList count]); 
} 
+0

這工作。我發現當分組類型設置爲相冊而不是流派時會出現錯誤。 – devinross 2009-09-18 02:37:48

0

嘗試着這樣一句話:我用它和它打印出來只是給我找

NSLog(@"%d",count);