• 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: Help with Storyboard Problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help with Storyboard Problem


  • Subject: Re: Help with Storyboard Problem
  • From: email@hidden
  • Date: Mon, 19 Jun 2017 15:00:33 -0400

> On Jun 19, 2017, at 2:24 PM, Dave <email@hidden> wrote:
>
> XCode 8.3.3.
>
> Hi All,
>
> I’m using storyboards on an iOS project and can’t seem to get it to work.
>
> I have two view controllers in the “Main.storyboard” file. The fist view
> controller has one button on it, that when clicked, I want it to go to the
> other view controller.
>
> I’ve tried using Segues but can’t get that to work so decided to to it
> manually.
>
> I have a method in the first view controller that is hooked to the button as
> so:
>
> -(IBAction) startGameAction:(id) theSender
> {
> LTWChaosBoardViewController*                  myGameViewController;
> UIView*
> myView;
>
> myGameViewController = [self.storyboard
> instantiateViewControllerWithIdentifier:@"LTWChaosBoardViewController1”];
> myView = myGameViewController.view;
> }
>
> This returns the correct View Controller but does not actually present it.
> How do I do this?
>
> The documentation is sooooooo poor that I just can’t find anything that is of
> help.
>
> All the Best
> Dave

UIViewController has a method: - (void)presentViewController:(UIViewController
*)viewControllerToPresent animated:(BOOL)flag completion:(void
(^)(void))completion;

so instead of setting myView =
call:
[self presentViewController:myGameViewController animated:YES completion: nil];
// (typed in Mail and I've been doing mostly Swift development so check my
syntax)

HTH,
Dave Reed

_______________________________________________

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: 
 >Help with Storyboard Problem (From: Dave <email@hidden>)

  • Prev by Date: Converting a Storyboard into separate NIBs.
  • Next by Date: Re: Help with Storyboard Problem
  • Previous by thread: Help with Storyboard Problem
  • Next by thread: Re: Help with Storyboard Problem
  • Index(es):
    • Date
    • Thread