PO(self);
PO(_locationManager.delegate);
PO([CLLocationHandler singleton]);
_locationManager = [[CLLocationManager alloc] init];
_locationManager.delegate = self;
PO(self);
PO(_locationManager.delegate);
NSAssert(_locationManager.delegate==self,@"They are meant for each other");
したがって、このコードはシミュレーターとほとんどの iPhone で機能します。私のビジネス パートナーが所有している、プログラムをデバッグできない魔法の iPhone が 1 台あります。
インストールしたプログラムを直接実行すると、コードは次のようになります。
��
<Warning>: *** -[NSKeyedUnarchiver initForReadingWithData:]: data is NULL
<Warning>: self: <CLLocationHandler: 0x1f8df560>
<Warning>: _locationManager.delegate: (null) <Warning>: [CLLocationHandler singleton]: <CLLocationHandler: 0x1f8df560>
<Warning>: self: <CLLocationHandler: 0x1f8df560>
<Warning>: _locationManager.delegate: <RwXSxTb_DelegateProxy: 0x1e594d00>
<Warning>: *** Assertion failure in -[CLLocationHandler additionalInitialization], /business/Dropbox/badgers/BadgerNew/CLLocationHandler.m:251
<Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'They are meant for each other'
delegateProxy って一体何?