Objective C Boolean Array

前端 未结 6 998
北恋
北恋 2020-12-08 18:54

I need to utilize an array of booleans in objective-c. I\'ve got it mostly set up, but the compiler throws a warning at the following statement:

[updated_use         


        
6条回答
  •  渐次进展
    2020-12-08 19:25

    You can either store NSNumbers:

    [updated_users replaceObjectAtIndex:index
                             withObject:[NSNumber numberWithBool:YES]];
    

    or use a C-array, depending on your needs:

    BOOL array[100];
    array[31] = YES;
    

提交回复
热议问题