Wrox Programmer Forums
|
BOOK: Beginning iPhone SDK Programming with Objective-C
This is the forum to discuss the Wrox book Beginning iPhone SDK Programming with Objective-C by Wei-Meng Lee; ISBN: 978-0-470-50097-2
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning iPhone SDK Programming with Objective-C 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 September 24th, 2010, 03:58 AM
Registered User
 
Join Date: Sep 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Changing Screen Orientation

I'm new at all this, and in the first bit of code required to change orientation Fig.2-14 I put the code in as told but nothing happens when I run it.

This is what I've got:

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIIn terfaceOrientation)interfaceOrientation { //
Return YES for supported orientations
return YES;
}
*/
 
Old October 8th, 2010, 05:12 PM
DMH DMH is offline
Registered User
 
Join Date: Oct 2010
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Peel it

Try pulling off the /* and */ to uncomment the block
In Xcode the text will become color coded instead of all the same (comment color of your choice in preferences) color

Code:
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
 //		return (interfaceOrientation == UIInterfaceOrientationPortrait);
	return YES;
}

//btnClicked: implementation
-(IBAction) btnClicked:(id)sender {
		//display alert
	UIAlertView *alert = [[UIAlertView alloc]
												initWithTitle:@"btnClicked"
												message:@"Starting" 
												delegate:self 
												cancelButtonTitle:@"Go ahead" 
												otherButtonTitles:nil, nil];
	[alert show];
	[alert release];
}
 
Old March 30th, 2011, 09:45 PM
Authorized User
 
Join Date: Mar 2011
Posts: 16
Thanks: 8
Thanked 0 Times in 0 Posts
Default removal of comments

thanks, been going crazy trying to get the orientation to work.

removed the comments (all of them) and success.

thanks.

just love these forums.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Changing screen resolution snufse ASP.NET 2.0 Basics 0 January 22nd, 2008 10:08 AM
Crystal Report Changing Orientation garrysmith68 Beginning VB 6 0 June 6th, 2006 06:42 AM
Table Orientation blaflin BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 2 November 11th, 2004 01:36 PM
changing text size on screen markhardiman Classic ASP Professional 4 August 31st, 2004 07:01 AM
Changing the screen resolution Dmitriy Pro VB 6 1 March 26th, 2004 05:31 AM





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