NSMutableArray addObjects - unrecognized-selector

前端 未结 1 343
盖世英雄少女心
盖世英雄少女心 2021-01-25 04:21

This is how I initialize my NSMutablearray. I copy the content of cityList into cityArray. Both are NSMutableArray. FYI, I declared the\'cityArray\' using extern.



        
相关标签:
1条回答
  • 2021-01-25 04:34

    An NSArray doesn't implement valueForKey:. Your want either an NSDictionary or use objectAtIndex:.

    Your second section of code should read:

    NSString *allCities = @"All Cities";
    [cityArray addObject:allCities];
    
    0 讨论(0)
提交回复
热议问题