Reputation: 6662
EDIT: Accept / Bounty goes to anyone who can tell me how to make a project that:
The previous question became a mess, and I've pretty much solved it myself. The Bounty is still up for grabs, if anyone wants to make a better version of my project.
Tested in Xcode 4, 5, iOS 6, 7, only on iPhone but should work on iPad aswell.
I looked hard for this when I worked on making this, so I hope I do someone a favour with this. Credit goes to Tiny Tim Games and https://stackoverflow.com/a/11801085/1701411 for the custom files. I've slightly modified these files to work. Usage instructions for noobs is inside the project readme! :)
Upvotes: 6
Views: 856
Reputation: 618
Here is a similar project template. http://www.mediafire.com/download/7dil7uolo5k1syr/Cocos2d+and+Storyboards+and+ARC+template.zip
Upvotes: 2
Reputation: 3918
I was also struggling with this issue. Here is how I created iOS project (with ARC and storyboards) that uses Cocos2d-iphone library.
In iOS single view application project:
Build Phases -> Compile Sources
and select all files from ProjectName/libs/ folder-fno-objc-arc
to disable ARC for that files (cocos2d lib files are written with all necessary memory management code so we don't need ARC for them).Header Search Paths
add: "libs/kazmath/include"
(go to project folder in Finder and double check path)Other Linker Flags
add: -lz -ObjC
Here is sample project: PROJECT TEMPLATE DOWNLOAD.
Upvotes: 1
Reputation: 6028
You haven't provided any code to support your question but from experience, you could try using self.view.bounds
instead of self.view.frame
?
Update
Create a property for your CCGLView
in your view controller:
@property (nonatomic) CCGLView *glView;
Then create an instance of it as you already have, but saved to your property.
[self setGlView:[[CCGLView alloc] initWithFrame:[[self view] bounds]];
Then implement viewWillLayoutSubviews
and update the frame of your CCGLView
to match.
- (void)viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];
[[self glView] setFrame:[[self view] bounds]];
}
Upvotes: 1