I would like to share a member between interfaces. If the member changed in an interface, the member from other interfaces should be changed automatically. How could I do this?
Definition:
Use:
Definition:
Code:
@interface A: NSObject
{ NSString *commonMember;}
@property (nonatomic, copy) NSString *commonMember;
@end
@interface B: NSObject
{ NSString *commonMember;}
@property (nonatomic, copy) NSString *commonMember;
@end
Code:
A* aa=[[A alloc] init];
B* bb=[[B alloc] init];
bb.commonMember=aa.commonMember;
// the value from one of the interfaces changed:
bb.commonMember=@"new value";
// aa.commonMember is not updated automatically