How to assign a value to a BOOL pointer in Objective-C?

前端 未结 4 653
耶瑟儿~
耶瑟儿~ 2020-12-30 19:11

I\'m having a bit of a confusion on how to assign a value to a BOOL pointer? Here\'s my code:

- (void)locationManager:(CLLocationManager *)manager didUpdateT         


        
4条回答
  •  自闭症患者
    2020-12-30 20:00

    You need to say

    *initialBroadcast = YES;
    

    initialBroadcast is a pointer aka memory address. The * gives access to the value at the memory address that the pointer holds. So initialBroadcast is a memory address, but *initialBroadcast is a boolean or char.

提交回复
热议问题