Possible error in documentation

394
1
12-29-2009 09:24 PM
deleted-user--c7HXKQt3eCH
New Contributor
This tutorial incorrectly states that to get the map to rotate all I need to do is include the following code in the view controller implementation file:

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

The above code snippet will keep the map in the portrait orientation and won't rotate the map when the device is moved to a landscape orientation. Instead of returning (interfaceOrientation == UIInterfaceOrientationPortrait) the method should return YES.
0 Kudos
1 Reply
DavidCardella
New Contributor III
Hi,

Thanks for your comment on the error. You are indeed correct in that there is a typo in the shouldAutorotateToInterfaceOrientation method. The contents of the method should read:

return interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown;

Note: the "!=" and not "==".

The same thing can be accomplished by returning YES.

Thanks again,
David
0 Kudos