NSPredicate on NSDictionary

后端 未结 3 1894
暖寄归人
暖寄归人 2021-02-08 21:30

I\'m trying to make sections in a table view based on the alphabet and sort my entries alphabetically under these sections.

I have collected the first letter in every en

3条回答
  •  梦如初夏
    2021-02-08 21:44

    Do you mean that bandsArray is an array of dictionaries? If so, and assuming each dictionary has a name key, you should be able to change the predicate to something like @"SELF.name beginswith[c] %@".

    If, on the other hand, bandsArray is actually a dictionary itself, maybe you want to do [[bandsArray allKeys] filteredArrayUsingPredicate...].

提交回复
热议问题