Objective-C dictionary inserting a BOOL

前端 未结 6 717
说谎
说谎 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:21

    You can insert @"YES" or @"NO" string objects and Cocoa will cast it to bool once you read them back.

    Otherwise I'd suggest creating dictionary using factory method like dictionaryWithObjectsAndKeys:.

提交回复
热议问题