NSPredicate on NSDictionary

后端 未结 3 1873
暖寄归人
暖寄归人 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:35

    Sorry, I didnt notice you had a NSArray of NSDictionaries.

    Read this thread: Using NSPredicate to filter an NSArray based on NSDictionary keys

    When you use NSDictionary, you should check by its Key... I'm not sure you're using the right approach!

    I would do something like: @implementation Word : NSObect { NSString *title; }

    then I would create a NSArray of Words and filter on them with: @"title beginswith[c] %@"

提交回复
热议问题