Wrox Programmer Forums
|
BOOK: Beginning iOS 4 Application Development
This is the forum to discuss the Wrox book Beginning iOS 4 Application Development by Wei-Meng Lee; ISBN: 978-0-470-91802-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iOS 4 Application 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 August 9th, 2011, 08:34 PM
Registered User
 
Join Date: Aug 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 3: UsingViews

I have started working through the book and have encountered a problem. On Page 49 it instructs us to create a new view based Application and name it UsingViews and then in the UsingViewsViewController.m add the following code to the viewDidLoad method:

UIAlertView *alert = [[UIAlertView alloc]
initWithTitle:@"Hello"
message:@"This is an alert view"
delegate:self
cancelButtonTitle:@"OK"
otherButtonTitles:nil];
[alert show];
[alert release];


Then it says to run the simulator and an alert window will popup. Except, when I run the simulator, the app launches and nothing happens. There is no alert window, it just shows a grey screen with the status bar on the top showing battery life and cell reception...Anyone have an idea as to what I might be doing wrong? Should I upgrade to Xcode 4? I am a complete noob.
 
Old August 10th, 2011, 07:56 AM
Friend of Wrox
 
Join Date: Aug 2010
Posts: 298
Thanks: 1
Thanked 62 Times in 60 Posts
Default

Are you getting any warnings in the console?
Copy and paste your code from your implementation file (…Controller.m) into a reply and/or send your project to
[email protected]

and your omission/error should be easy to find.

Bob
 
Old August 10th, 2011, 10:08 AM
Registered User
 
Join Date: Aug 2011
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

No there were no errors when I launched the simulator. Here is the code:

Code:
/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
	UIAlertView *alert = [[UIAlertView alloc]
							initWithTitle:@"Hello"
							      message:@"This is an alert view"
							     delegate:self
						cancelButtonTitle:@"OK"
						otherButtonTitles:nil];
	[alert show];
	[alert release];   
    [super viewDidLoad];
}
*/
 
Old August 20th, 2011, 02:55 AM
Authorized User
 
Join Date: Jun 2011
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you're viewDidLoad method is not active because it is 'commented out'.
this is due to the
Code:
/*
at the top and the
Code:
*/
at the bottom of your code. remove both of those and run again. while doing so you will be able to observe the code in question not being colored green anymore. green is xcode's color for comments which are ignored by the compiler.
 
Old October 3rd, 2011, 03:08 PM
Registered User
 
Join Date: Sep 2011
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Execution terminated UsingViews p 49

I am having a problem with the same problem. Execution is aborted with this message [only initial part of message shown]

2011-10-03 15:04:59.104 UsingViews[3580:b303] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "UsingViewsViewController" nib but the view outlet was not set.'





Similar Threads
Thread Thread Starter Forum Replies Last Post
Ch. 3 - usingViews Alert and ActionSheet johnoeffinger BOOK: Beginning iPad Application Development 7 August 11th, 2010 10:09 AM
Chapter 6 - Code Download Missing for this Chapter dbaechtel BOOK: Professional SharePoint 2007 Development ISBN: 978-0-470-11756-9 0 August 11th, 2009 11:02 AM
Generics chapter 12 difficult chapter i found ...? Larryz C# 2005 1 July 4th, 2007 09:40 PM





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