• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: sending data to a view not yet displayed
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

References: 
 >sending data to a view not yet displayed (From: Shane <email@hidden>)
 >Re: sending data to a view not yet displayed (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: sending data to a view not yet displayed
  • Next by Date: Re: sending data to a view not yet displayed
  • Previous by thread: Re: sending data to a view not yet displayed
  • Next by thread: Re: sending data to a view not yet displayed
  • Index(es):
    • Date
    • Thread