Wrox Programmer Forums
|
BOOK: Professional iPhone and iPad Application Development
This is the forum to discuss the Wrox book Professional iPhone and iPad Application Development by Gene Backlin; ISBN: 978-0-470-87819-4
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional iPhone and iPad 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 February 27th, 2011, 07:50 PM
Registered User
 
Join Date: Feb 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 1 - Toolbar rotation example

Hi, small query. I have the simple toolbar working in Simulator, but when it rotates it does not seem to rotate at 45 degress, 180 degress, etc

Same result with your code from download.

I have tried using 90 deg, etc but it does not perform as expected.

Looking in the reference docs, should it use Radians?

I am using SDK 4.2. Thank you for any help.

Mike
 
Old February 27th, 2011, 08:59 PM
Wrox Author
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 9 Times in 7 Posts
Default

You are correct !

replace the current method with this.

Code:
#pragma mark -
#pragma mark Action methods

- (IBAction)rotateView:(id)sender {
	static CGFloat angle = 0.0;
	
	switch ([sender tag]) {
		case 0:
			angle += (45.0 * M_PI/180);
			break;
		case 1:
			angle += (180.0 * M_PI/180);
			break;
		case 2:
			angle -= (180.0 * M_PI/180);
			break;
		case 3:
			angle -= (45.0 * M_PI/180);
			break;
		default:
			break;
	}
	
	CGAffineTransform transform=CGAffineTransformMakeRotation(angle);
	[imageView setTransform:transform];
}
Thank you for your post !!!

Last edited by gbacklin; February 27th, 2011 at 09:04 PM..
The Following User Says Thank You to gbacklin For This Useful Post:
[email protected] (February 27th, 2011)
 
Old February 28th, 2011, 04:57 AM
Registered User
 
Join Date: Feb 2009
Posts: 3
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Gene, thanks and so far I like the content, format and learning style of the book ... onwards ... Mike
 
Old February 28th, 2011, 10:05 AM
Wrox Author
 
Join Date: Oct 2010
Posts: 61
Thanks: 0
Thanked 9 Times in 7 Posts
Default

Quote:
Originally Posted by [email protected] View Post
Gene, thanks and so far I like the content, format and learning style of the book ... onwards ... Mike
Thank you for your kind words and support, it is appreciated. I am glad that I am able to help you.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter Toolbar does show display lstew452 BOOK: Beginning ASP.NET 4 : in C# and VB 2 August 15th, 2010 02:07 PM
text rotation bimbolin BOOK: Professional Crystal Reports for VS.NET 1 January 17th, 2007 05:24 PM
3D Image rotation in C#.NET satishnagare C# 1 December 22nd, 2005 06:29 PM
About the toolbar momowu0701 BOOK: Beginning VB.NET 2nd Edition/Beginning VB.NET 2003 0 March 1st, 2005 09:23 AM
Toolbar sangata VS.NET 2002/2003 2 April 13th, 2004 05:14 AM





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