Re: sending data to a view not yet displayed
Re: sending data to a view not yet displayed
- Subject: Re: sending data to a view not yet displayed
- From: Shane <email@hidden>
- Date: Sat, 15 Jan 2011 16:53:28 -0600
>> So I guess my question is, how do I make sure my view is able to
>> receive the data I want sent to it before it is ever displayed. I hope
>> that makes sense.
>
>
> Put the initialization in the -awakeFromNib method of that view.
>
I moved the view swapping setup from the init to the awakeFromNib of
the app controller, but it didn't make a difference. I have this in
the awakeFromNib of my app controller.
- (void) awakeFromNib
{
// …
DetailsViewController *dvc;
dvc = [[ProgressViewController alloc] initWithController:self];
[dvc setManagedObjectContext:[self managedObjectContext]];
[detailViewControllers addObject:dvc];
[dvc release];
dvc = [[ProgressRunViewController alloc] initWithController:self];
[dvc setManagedObjectContext:[self managedObjectContext]];
[detailViewControllers addObject:dvc];
[dvc release];
dvc = [[DataDetailsViewController alloc] initWithController:self];
[dvc setManagedObjectContext:[self managedObjectContext]];
[detailViewControllers addObject:dvc];
[dvc release];
//...
}
And this is the init of each of the Controllers setup in the
awakeFromNib in the app controller, with of course a different nib
name.
- (id) init
{
self = [super initWithNibName:@"DataDetailsView" bundle:nil];
if (!self) {
return nil;
}
return self;
}
- (id) initWithController:(AppController *) controller
{
[self init];
if (!self) {
return nil;
}
appController = controller;
return self;
}
Did I not understand your response correctly?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden