IOS KVO work wrong

At first sorry for my english. So i faced with strange kvo behavior. I have a class A with property "propA" of class B; class B have property "propB". So i want class A to watch property "propB". But when i add observer self from class A for keypath "propA.propB" IOS add observer for propB and add observer for propA. So object of class A must receive events when some one change propA or propB. All good, but when i write another object in propA Xcode stop work and tell me that object of class B was deallocated but here is observers that registered on it.

it looking like this:

@interface A: NSObject
{
   @property B propA;
}

@interface B: NSObject
{
   @property C propB;
}


@implementation A
-(void)someMethod
{
   [self addObserver:self forKeyPath:@"propA.propB"];
}
链接地址: http://www.djcxy.com/p/47350.html

上一篇: C ++

下一篇: IOS KVO工作错了