Loading

Tuesday, January 4, 2011

Create Object of class to use as a View

in ChildClass.h
@interface
{
UINavigationController *ng;
id parentController;
}
@property(nonatomic, retain) id ParentController;
@property (nonatomic, retain) IBOutlet UINavigationController *ng;

in ChildClass.m

@synthesize ParentController = parentController;
@synthesize ng;


in ParentClss.m

ChildClass* childObject = [[ChildClass alloc]initWithNibName:@"ChildView" bundle:[NSBundle mainBundle]];
childObject.ParentController=self;
childObject.ng = self.navigationController;
[childObject.view setFrame:CGRectMake(Frame)];
[YourView addSubview:childObject.view];
[self.view sendSubviewToBack:YourView];

No comments:

Post a Comment