After several tries, I found the next to work the best :

- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {

if((toInterfaceOrientation == UIDeviceOrientationLandscapeLeft) || (toInterfaceOrientation == UIDeviceOrientationLandscapeRight)) {
NSLog(@”didRotateFromInterfaceOrientation Landscape”);
isPortrait = NO; //Global variable
}
else {
NSLog(@”didRotateFromInterfaceOrientation Potrait”);
isPortrait = YES;
}

Amaze your friends with games you create.
Get your game played by thousands of people and earn money.

With 'Game Creator' application for iPhone or iPod, you can create games without
the need of coding.



Try it now - Press this link

Checkout this post

I tried to compile my code against 3.2 (in order to test in ipad simulator), but I got the following error:

“can not find protocol NSXMLParserDelegate”

I added the following line for the first warning, and all the 22 warnings were gone (and even the code worked :) )

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= __IPHONE_4_0
@protocol NSXMLParserDelegate
@end
#endif
@interface MGTwitterXMLParser : NSObject <NSXMLParserDelegate> {

In case of application crash :

1) Get the log file : http://aplus.rs/apple/how-to-find-crash-logs-for-iphone-applications-on-mac-vista-and-xp/

2) Open the Organizer in xCode

3) Drag the log into the ‘Device Logs’ on the right side

Good luck…

When adding a shape (non standard) to your box2d project, you need to define the vertices of the shape.

Remember that the (0,0) is in the middle of the Sprite.

Or you can use this great tool to help you :

http://www.springenwerk.com/2010/02/introducing-vertexhelper-for-box2d.html

http://www.box2d.org/manual.html

http://www.linuxuser.at/elements/doc/box2d/classb2_body.htm

  1. Under under Project->Edit Active Executable -> Arguments tab -> Environment variables section I added and set to YES the following variables: NSAutoreleaseFreedObjectCheckEnabled, NSZombieEnabled NSDebugEnabled.
  2. Under the Run menu, I selected “Enable Guard Malloc”

http://stackoverflow.com/questions/601074/objective-c-message-sent-to-deallocated-instance-0x5633b0

If you get compilation errors after adding:

#import “Box2D.h”

Change the file ext to .mm => This should tell the compiler to use C++, and solve the problem

Hi,

One of the popular engines for iPhone is cocos2D

It should ease the development of 2D games.

Integrated physics engine (both Box2d and Chipmunk).

A good tutorial for the installation can be found here

© 2011 W2OM - iPhone by code Suffusion theme by Sayontan Sinha