How to print Boolean flag in NSLog?

后端 未结 11 2348
深忆病人
深忆病人 2020-12-02 04:06

Is there a way to print value of Boolean flag in NSLog?

11条回答
  •  春和景丽
    2020-12-02 04:32

    NSArray *array1 = [NSArray arrayWithObjects:@"todd1", @"todd2", @"todd3", nil];
    bool objectMembership = [array1 containsObject:@"todd1"];
    NSLog(@"%d",objectMembership);  // prints 1 or 0
    

提交回复
热议问题