"" ,
, , , , , , , .
, , , , .
ParentView.h
@protocol IAmYourFatherAndMotherProtocol
@class ChildView;
@interface ParentView : UIViewController <IAmYourFatherAndMotherProtocol>
{
NSInteger statusID;
}
@property (nonatomic) NSInteger statusID;
@protocol IAmYourFatherAndMotherProtocol
@property (nonatomic) NSInteger statusID;
@end
@end
ChildView.h
#import "ParentView.h"
@interface ChildView : UIViewController
{
id<IAmYourFatherAndMotherProtocol> delegate;
}
@property (nonatomic, assign) id <IAmYourFatherAndMotherProtocol> delegate;
ChildView ParentView.m "self" , :
ChildView *newChild = [[ChildView alloc] init];
newChild.delegate = self;
"statusID" ParentView ChildView.m :
delegate.statusID = 1337;
,