Re: UISplitViewController some of the time
Re: UISplitViewController some of the time
- Subject: Re: UISplitViewController some of the time
- From: "Eric E. Dolecki" <email@hidden>
- Date: Thu, 03 Nov 2011 16:04:13 -0400
I am not using nibs. Per Apple's guidelines, a splitviewcontroller must be
the root. My "home" view controller needs to fill the whole screen, over
top of the splitviewcontroller, which I've done.
Right now I am trying to get the storyboard scene for my
HomeUIViewController to be used instead of just calling up my class and
having to do all the UI with code. I'd like to use the scene instead. This
is happening in the app delegate FYI.
On Thu, Nov 3, 2011 at 3:59 PM, Conrad Shultz <email@hidden
> wrote:
> On 11/3/11 10:28 AM, Eric E. Dolecki wrote:
> > Sorry - but I am not following you. What I just tried that almost work
> is:
> >
> > In my detail view controller for the split view controller, I added in
> it's
> > viewDidLoad:
> >
> > HomeUIViewController *tmp = [[HomeUIViewController alloc] init];
> > [self presentModalViewController:tmp animated:NO];
> > [[NSNotificationCenter defaultCenter] addObserver:self
> > selector:@selector(removeMainView:)
> > name:@"removeMainView" object:nil];
> >
> > And added this method to the same detail view controller:
> >
> > - (void)removeMainView:(NSNotification *)notification {
> > [self dismissModalViewControllerAnimated:YES];
> > }
> > In my HomeUIViewController I have a button that broadcasts that
> > "removeMainView" - which causes the viewcontroller to be removed.
>
> Sorry, didn't you want the home view to be the initial view? If so,
> this seems backwards.
>
> I'm pretty sure Matt was recommending you do something more like the
> following.
>
> In your main view controller (that is, the one initially visible), being
> the HomeUIViewController, have an action that responds to your button
> (typed in email, be warned):
>
> MySplitViewController *svc = [[MySplitViewController alloc]
> initWithNibName:@"MySplitViewController" bundle:nil];
>
> [self presentModalViewController:svc animated:YES];
>
> [svc release];
>
> Then in MySplitViewController, have some UI that allows you to return to
> the home screen, and simply call:
>
> [self dismissModalViewControllerAnimated:YES];
>
> No notifications needed.
>
> As an aside, notifications are used primarily for decoupling objects and
> for communicating with an indeterminate number of objects. These
> conditions don't really apply here. If you need a modally presented
> view controller to communicate with its presenter, it should probably
> use delegation or a similar form of direct messaging.
>
>
> --
> Conrad Shultz
>
> Synthetiq Solutions
> www.synthetiqsolutions.com
>
_______________________________________________
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