Error: Indexing expression is invalid because subscript type 'NSUInteger' is not an integral or objective c pointer type

后端 未结 1 926
你的背包
你的背包 2021-01-06 08:09

I have an array named \"rankStrings\" and I am trying to get the data from it at an index as below...

NSArray *rankStrings = @[@\"1\", @\"2\", @\"3\", @\"4\"         


        
相关标签:
1条回答
  • 2021-01-06 08:45

    You are using a pointer to a NSUInteger, and the array expects a NSUInteger (primitive type) as index. Declare your property like this instead:

    @property (nonatomic,assign) NSUInteger rank;
    
    0 讨论(0)
提交回复
热议问题