Az iPhone SDK, tudjuk csak megfigyelni tárgyakat, és nem rugóstagok, mint CLLocationCoordinate2D?
Példa: Van néhány nagyon egyszerű kódot, ahol szeretnék, hogy megfigyelje a tulajdon típusú CLLocationCoordinate2D, már gondoskodott arról, hogy szintetizálni a ABC.m.
@interface ABC
{
CLLocationCoordinate2D currentLocation;
}
@property (nonatomic, readwrite) CLLocationCoordinate2D currentLocation;
Most egy másik osztályba én:
[ABC addObserver:self forKeyPath:@currentLocation options:NSKeyValueObservingOptionNew context:NULL];
Valamilyen oknál fogva, a observeValueForKeyPath módszer nem számol be, hogy kulcserőforrás „ currentLocation” változott.
Kösz,
SJS













