Objective-C dictionary inserting a BOOL

前端 未结 6 714
说谎
说谎 2020-12-13 06:01

OK, I\'m a little confused. It\'s probably just a triviality.

I\'ve got a function which looks something like this:

- (void)getNumbersForNews:(BOOL)         


        
6条回答
  •  感情败类
    2020-12-13 06:26

    Objective-C containers can store only Objective-C objects so you need to wrap you BOOL in some object. You can create a NSNumber object with [NSNumber numberWithBool] and store the result.
    Later you can get your boolean value back using NSNumber's -boolValue.

提交回复
热议问题