• 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: Storyboard scene and UIViewController
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Storyboard scene and UIViewController


  • Subject: Re: Storyboard scene and UIViewController
  • From: "Eric E. Dolecki" <email@hidden>
  • Date: Thu, 03 Nov 2011 15:49:20 -0400

I should note I am trying to do this from the AppDelegate.



On Thu, Nov 3, 2011 at 3:40 PM, Eric E. Dolecki <email@hidden> wrote:

> In my storyboard I dropped a UIViewController object in, gave it
> identifier "deanna" - it's not linked to anything (segue). For Custom Class
> I assigned HomeUIViewController. I gave it a bright blue background color
> just to make sure it's being used instead of just code.
>
> Then in my code:
>
> UIStoryboard *storyboard = [UIStoryboard storyboardWithName:
> @"MainStoryboard" bundle:[NSBundle mainBundle]];
> HomeUIViewController *hv = [storyboard
> instantiateViewControllerWithIdentifier:@"deanna"];
> [splitViewController presentModalViewController:hv animated:NO];
>
> - It's being presented, only the UI objects I dropped onto the scene
> aren't there, I get a default gray background... so the scene in the
> storyboard isn't being used.
>
> What am I missing?
>
>
>
> On Thu, Nov 3, 2011 at 3:12 PM, Ben Kennedy <email@hidden> wrote:
>
>> On 03 Nov 2011, at 12:05 pm, Eric E. Dolecki wrote:
>>
>> > This is great, but I have to generate all the UI for the view
>> controller in
>> > code in the class. Is it possible to layout a scene in a Storyboard and
>> > associate it with the view controller so that the UI in the scene will
>> be
>> > used instead of me doing it all in code?
>>
>> Sure.  Create your scene in the storyboard, assign an "identifier" string
>> to it in the Attributes inspector, and then instantiate it using
>> -[UIStoryboard instantiateViewControllerWithIdentifier:].
>>
>> -b
>>
>> --
>> Ben Kennedy, chief magician
>> Zygoat Creative Technical Services
>> http://www.zygoat.ca
>>
>>
>
_______________________________________________

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: 
 >Storyboard scene and UIViewController (From: "Eric E. Dolecki" <email@hidden>)
 >Re: Storyboard scene and UIViewController (From: Ben Kennedy <email@hidden>)
 >Re: Storyboard scene and UIViewController (From: "Eric E. Dolecki" <email@hidden>)

  • Prev by Date: Re: Storyboard scene and UIViewController
  • Next by Date: Re: Sandboxing disallows AppleEvents?
  • Previous by thread: Re: Storyboard scene and UIViewController
  • Next by thread: Re: Storyboard scene and UIViewController
  • Index(es):
    • Date
    • Thread