Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK: Beginning iOS Game Development
This is the forum to discuss the Wrox book Beginning iOS Game Development by Patrick Alessi ; ISBN: 978-1-1181-0732-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iOS Game Development section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 20th, 2013, 11:53 PM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Nov 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Xcode 5 and Storyboard?!?

Ok first post here we go.

So I was reading the book (obviously the book that this question was posted in) and I just got to the part where Alessi was talking about creating the simple interface application (Pg. 37 if you want to see). Now I have Xcode 5 and if you know anything about that, then you know it doesn't have the check/uncheck storyboard at the start of creating a project, and in the tutorial it says you have to go to the .xib file which isn't there, and I am guessing that is because of storyboard.

Now here is my question: How do i add the ViewController.xib file, and how do I get rid of the storyboard? Do I just delete it?

P.S. I am a beginner in Objective-C (also I don't have much knowledge in programming) and I am just starting out with Xcode so thanks in advance .
Old November 22nd, 2013, 12:45 PM
Friend of Wrox
Points: 1,671, Level: 16
Points: 1,671, Level: 16 Points: 1,671, Level: 16 Points: 1,671, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts

These are the steps you will need to take.
1. In the Project Navigator (interface column on the left) delete the storyboard and the ViewController.h and .m files. (select Move to trash in the dialogue that comes up when you hit the delete key)
2. In the Main Menu select New>File. In the dialogue that comes up name the file ViewController, and choose subclass of UIViewController. Make sure the "With XIB for user interface" box is checked
3. In the Project Navigator select the uppermost item (has Xcode icon and the project name) In the Main editor you should see an option for "General". Under this there is a disclosure triangle and a section titled Deployment Info. If it is not open, open the disclosure to see your options. Delete the word "Main" from the Main Interface textfield.
4. Select the AppDelegate.h file edit it to read as follows (changes are in bold):
#import <UIKit/UIKit.h>
@class ViewController;

@interface AppDelegate : UIResponder <UIApplicationDelegate>

@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) ViewController *viewController;

5. Select the AppDelegate.m file and edit it to read as follows (changes are in bold):
#import "AppDelegate.h"
#import "ViewController.h"

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    // Override point for customization after application launch.
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    self.viewController = [[ViewController alloc] initWithNibName:@"ViewController" bundle:nil];
    self.window.rootViewController = self.viewController;
    [self.window makeKeyAndVisible];
    return YES;
You can now follow the steps in the book to set up the interface. There are 2 errors in the book on p. 40 that will need to be corrected as well. Steps 18 and 19 need to refer to mySlider as self.mySlider

- (IBAction)buttonPressed:(id)sender {
    self.myLabel.text = [[NSNumber numberWithInt:counter] stringValue];
    self.mySlider.value = counter;

- (IBAction)sliderMoved:(id)sender {
    counter = self.mySlider.value;
    self.myLabel.text = [[NSNumber numberWithInt:counter] stringValue];
In the downloadable code the author did not initially make the slider outlet a property, so it can be accessed directly. As it is in the book it is a property, so the accessor should be used. The implementation in the book did not reflect this change.


Similar Threads
Thread Thread Starter Forum Replies Last Post
xcode 4? kingfingerjr BOOK: Beginning iOS Game Development 2 August 22nd, 2013 07:58 AM
Chapter 1 and Xcode 4.2 diggerbyte BOOK: Professional iPhone and iPad Database Application Programming 0 March 17th, 2012 10:35 PM
Storyboard normannasty BOOK: Beginning iPhone SDK Programming with Objective-C 1 March 15th, 2012 11:23 PM
Xcode vs Dashcode Rich Mansfield Xcode 2 October 26th, 2011 10:07 AM
xcode for "learning" Molder Intro Programming 0 April 24th, 2008 11:10 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.