NSPredicate on NSDictionary

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

    #import 
    // clang -framework Foundation Siegfried.m 
        int
    main() {
        NSArray *arr = @[
            @{@"1" : @"Fafner"},
            @{@"1" : @"Fasolt"}
        ];
        NSPredicate *p = [NSPredicate predicateWithFormat: @"SELF['1'] CONTAINS 'e'"];
        NSArray *res = [arr filteredArrayUsingPredicate:p];
        NSLog(@"Siegfried %@", res);
        return 0;
    }
    

提交回复
热议问题