Skip to content

Instantly share code, notes, and snippets.

@quique123
Created February 27, 2013 19:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save quique123/5050916 to your computer and use it in GitHub Desktop.
Save quique123/5050916 to your computer and use it in GitHub Desktop.
Cocos2d Image Size Bug
//
// AppDelegate.m
// Honduras
//
// Created by Marcio Valenzuela on 7/8/11.
// Copyright Personal 2011. All rights reserved.
//
#import "cocos2d.h"
#import "AppDelegate.h"
#import "GameConfig.h"
#import "HelloWorldLayer.h"
#import "RootViewController.h"
#import "SimpleAudioEngine.h"
#import "Level.h"
#import "GameOverScene.h"
#import "NewLevelScene.h"
#import "GameScene.h"
#import "GameManager.h"
#import "Appirater.h"
#import "MZIAPHelper.h"
@implementation AppDelegate
@synthesize window;
@synthesize mainScene = _mainScene;
@synthesize gameOverScene = _gameOverScene;
@synthesize newLevelScene = _newLevelScene;
@synthesize levels = _levels;
@synthesize curLevelIndex = _curLevelIndex;
- (void) removeStartupFlicker
{
//
// THIS CODE REMOVES THE STARTUP FLICKER
//
// Uncomment the following code if you Application only supports landscape mode
//
#if GAME_AUTOROTATION == kGameAutorotationUIViewController
#endif
}
- (void) applicationDidFinishLaunching:(UIApplication*)application
{
//IAPS
[MZIAPHelper sharedInstance];
// Init the window
window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Try to use CADisplayLink director
// if it fails (SDK < 3.1) use the default director
if( ! [CCDirector setDirectorType:kCCDirectorTypeDisplayLink] )
[CCDirector setDirectorType:kCCDirectorTypeDefault];
CCDirector *director = [CCDirector sharedDirector];
// Init the View Controller
viewController = [[RootViewController alloc] initWithNibName:nil bundle:nil];
viewController.wantsFullScreenLayout = YES;
// Create the EAGLView manually
// 1. Create a RGB565 format. Alternative: RGBA8
// 2. depth format of 0 bit. Use 16 or 24 bit for 3d effects, like CCPageTurnTransition
//
//
EAGLView *glView = [EAGLView viewWithFrame:[window bounds]
pixelFormat:kEAGLColorFormatRGB565 // kEAGLColorFormatRGBA8
depthFormat:0 // GL_DEPTH_COMPONENT16_OES
];
// attach the openglView to the director
[director setOpenGLView:glView];
// // Enables High Res mode (Retina Display) on iPhone 4 and maintains low res on all other devices
if( ! [director enableRetinaDisplay:YES] )
CCLOG(@"Retina Display Not supported");
//
// VERY IMPORTANT:
// If the rotation is going to be controlled by a UIViewController
// then the device orientation should be "Portrait".
//
// IMPORTANT:
// By default, this template only supports Landscape orientations.
// Edit the RootViewController.m file to edit the supported orientations.
//
#if GAME_AUTOROTATION == kGameAutorotationUIViewController
[director setDeviceOrientation:kCCDeviceOrientationPortrait];
#else
[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
#endif
[director setAnimationInterval:1.0/60];
[director setDisplayFPS:YES];
// make the OpenGLView a child of the view controller
[viewController setView:glView];
// make the View Controller a child of the main window
[window setRootViewController:viewController];
//[window addSubview: viewController.view];
[window makeKeyAndVisible];
// Default texture format for PNG/BMP/TIFF/JPEG/GIF images
// It can be RGBA8888, RGBA4444, RGB5_A1, RGB565
// You can change anytime.
[CCTexture2D setDefaultAlphaPixelFormat:kCCTexture2DPixelFormat_RGBA8888];
// Removes the startup flicker
[self removeStartupFlicker];
//***INSERT LEVEL CODE
//
// Load levels
self.levels = [[[NSMutableArray alloc] init] autorelease];
Level *level1 = [[[Level alloc] initWithLevelNum:1 spawnRate:2 bgImageName:@"bg.png"] autorelease];
Level *level2 = [[[Level alloc] initWithLevelNum:2 spawnRate:1 bgImageName:@"bg2.png"] autorelease];
[_levels addObject:level1];
[_levels addObject:level2];
self.curLevelIndex = 0;
// Run the intro Scene
//[[CCDirector sharedDirector] runWithScene:kMainScene];
[[GameManager sharedGameManager] setupAudioEngine];
[[GameManager sharedGameManager] runSceneWithID:kMainMenuScene];
[Appirater appLaunched:YES];
}
// Supported orientations: Landscape. Customize it for your own needs
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return UIInterfaceOrientationIsLandscape(interfaceOrientation);
}
- (Level *)curLevel {
return [_levels objectAtIndex:_curLevelIndex];
}
- (void)applicationWillResignActive:(UIApplication *)application {
[[CCDirector sharedDirector] pause];
}
- (void)applicationDidBecomeActive:(UIApplication *)application {
[[CCDirector sharedDirector] resume];
}
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
[[CCDirector sharedDirector] purgeCachedData];
[TestFlight passCheckpoint:@"appDidReceiveMemoryWarning"];
TFLog(@"memory warning");
}
-(void) applicationDidEnterBackground:(UIApplication*)application {
[[CCDirector sharedDirector] stopAnimation];
}
-(void) applicationWillEnterForeground:(UIApplication*)application {
[[CCDirector sharedDirector] startAnimation];
[Appirater appEnteredForeground:YES];
}
- (void)applicationWillTerminate:(UIApplication *)application {
CCDirector *director = [CCDirector sharedDirector];
[[director openGLView] removeFromSuperview];
[viewController release];
[window release];
[director end];
}
- (void)applicationSignificantTimeChange:(UIApplication *)application {
[[CCDirector sharedDirector] setNextDeltaTimeZero:YES];
}
#pragma scene management to be relinquished
- (void)loadGameOverScene {
[_gameOverScene.layer.label setString:@"You Lose :["];
[_gameOverScene.layer reset];
[[CCDirector sharedDirector] replaceScene:_gameOverScene];
}
- (void)loadWinScene {
[_gameOverScene.layer.label setString:@"You Win!"];
[_gameOverScene.layer reset];
[[CCDirector sharedDirector] replaceScene:_gameOverScene];
}
- (void)loadNewLevelScene{
[_newLevelScene.layer reset];
[[CCDirector sharedDirector] replaceScene:_newLevelScene];
}
- (void)nextLevel {
//[_mainScene.layer reset];
//this previous method must call...OriginalScene reset method which:
// resets arrays
// cleans all sprites
// remove old backgrounds
// calls new background and sets it via delegate
// resets stats and timers
// resets scores
[[CCDirector sharedDirector] replaceScene:_mainScene];
}
- (void)restartGame {
_curLevelIndex = 0;
[self nextLevel];
}
- (void)levelComplete {
_curLevelIndex++;
if (_curLevelIndex >= [_levels count]) {
_curLevelIndex = 0;
[self loadWinScene];
} else {
[self loadNewLevelScene];
}
}
- (void)dealloc {
self.mainScene = nil;
self.gameOverScene = nil;
[[CCDirector sharedDirector] end];
[window release];
[super dealloc];
}
@end
//
// MainMenuLayer.m
//
// Created by Marcio Valenzuela on 8/26/11.
// Copyright 2011 Personal. All rights reserved.
//
#import "MainMenuLayer.h"
#import "MZIAPHelper.h"
#import "IAPProduct.h"
#import <StoreKit/StoreKit.h>
#import "MZIAPHelper.h"
@interface MainMenuLayer()
-(void)displayMainMenu;
-(void)displaySceneSelection;
@end
@implementation MainMenuLayer {
//for IAPs
NSArray * _products;
NSNumberFormatter * _priceFormatter;
}
-(void)playScene:(CCMenuItemFont*)itemPassedIn {
if ([itemPassedIn tag] == 1) {
[[GameManager sharedGameManager] runSceneWithID:kFirstScene];
} else if ([itemPassedIn tag] == 2) {
[[GameManager sharedGameManager] runSceneWithID:kSecondScene];
} else if ([itemPassedIn tag] == 3) {
[[GameManager sharedGameManager] runSceneWithID:kThirdScene];
} else if ([itemPassedIn tag] == 4) {
[[GameManager sharedGameManager] runSceneWithID:kFourthScene];
} else if ([itemPassedIn tag] == 5) {
[[GameManager sharedGameManager] runSceneWithID:kCreditsScene];
} else {
CCLOG(@"Unexpected item. Tag was: %d", [itemPassedIn tag]);
}
}
-(void)buyLevel{
CCLOG(@"Show the Options screen");
[[GameManager sharedGameManager] runSceneWithID:kBuyLevelScene];
}
-(void)displayMainMenu {
CGSize screenSize = [CCDirector sharedDirector].winSize;
if (sceneSelectMenu != nil) {
[sceneSelectMenu removeFromParentAndCleanup:YES];
}
//RETINA TEST FIRST
if ([[UIScreen mainScreen]scale] == 1){
//NONRETINA CODE
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
// iPAD NONRETINA
CCMenuItemImage *playGameButton = [CCMenuItemImage
itemFromNormalImage:@"mzhattrace-iPad.png"
selectedImage:@"mzhattrace-iPad.png"
disabledImage:nil
target:self
selector:@selector(displaySceneSelection)];
CCMenuItemImage *buyLevelsButton = [CCMenuItemImage
itemFromNormalImage:@"coin-iPad.png"
selectedImage:@"coin-iPad.png"
disabledImage:nil
target:self
selector:@selector(buyLevel)];
mainMenu = [CCMenu menuWithItems:playGameButton,buyLevelsButton,nil];
} else {
// iPHONE NON RETINA
CCMenuItemImage *playGameButton = [CCMenuItemImage
itemFromNormalImage:@"mzhattrace.png"
selectedImage:@"mzhattrace.png"
disabledImage:nil
target:self
selector:@selector(displaySceneSelection)];
CCMenuItemImage *buyLevelsButton = [CCMenuItemImage
itemFromNormalImage:@"coin.png"
selectedImage:@"coin.png"
disabledImage:nil
target:self
selector:@selector(buyLevel)];
mainMenu = [CCMenu menuWithItems:playGameButton,buyLevelsButton,nil];
}
} else if ([[UIScreen mainScreen]scale] == 2){
//RETINA CODE
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
//iPAD RETINA
CCMenuItemImage *playGameButton = [CCMenuItemImage
itemFromNormalImage:@"mzhattrace-iPad-hd.png"
selectedImage:@"mzhattrace-iPad-hd.png"
disabledImage:nil
target:self
selector:@selector(displaySceneSelection)];
CCMenuItemImage *buyLevelsButton = [CCMenuItemImage
itemFromNormalImage:@"coin-iPad-hd.png"
selectedImage:@"coin-iPad-hd.png"
disabledImage:nil
target:self
selector:@selector(buyLevel)];
mainMenu = [CCMenu menuWithItems:playGameButton,buyLevelsButton,nil];
} else {
//iPHONE RETINA
CCMenuItemImage *playGameButton = [CCMenuItemImage
itemFromNormalImage:@"mzhattrace-hd.png"
selectedImage:@"mzhattrace-hd.png"
disabledImage:nil
target:self
selector:@selector(displaySceneSelection)];
CCMenuItemImage *buyLevelsButton = [CCMenuItemImage
itemFromNormalImage:@"coin-hd.png"
selectedImage:@"coin-hd.png"
disabledImage:nil
target:self
selector:@selector(buyLevel)];
mainMenu = [CCMenu menuWithItems:playGameButton,buyLevelsButton,nil];
}
}
//Continue with menu setup
[mainMenu alignItemsVerticallyWithPadding:screenSize.height * 0.059f];
[mainMenu setPosition:ccp(screenSize.width * 2,screenSize.height / 2)];
id moveAction = [CCMoveTo actionWithDuration:1.2f position:ccp(screenSize.width * 0.85f,
(screenSize.height / 2) )];
id moveEffect = [CCEaseIn actionWithAction:moveAction rate:1.0f];
[mainMenu runAction:moveEffect];
[self addChild:mainMenu z:0 tag:kMainMenuTagValue];
}
-(void)displaySceneSelection {
CGSize screenSize = [CCDirector sharedDirector].winSize;
if (mainMenu != nil) {
[mainMenu removeFromParentAndCleanup:YES];
}
//FIRST LABEL
CCLabelTTF *playScene1Label = [CCLabelTTF labelWithString:@"See Mel Eat" dimensions:CGSizeMake(175,50) alignment:NSTextAlignmentCenter fontName:@"StencilRegular" fontSize:32];
playScene1Label.color = ccc3(0, 0, 0);
//CCLabelBMFont *playScene1Label = [CCLabelBMFont labelWithString:@"See Mel Eat" fntFile:@"Arial.fnt"];
CCMenuItemLabel *playScene1 = [CCMenuItemLabel itemWithLabel:playScene1Label target:self selector:@selector(playScene:)];
[playScene1 setTag:1];
//SECOND LABEL
CCLabelTTF *playScene2Label = [CCLabelTTF labelWithString:@"See Mel Fly" dimensions:CGSizeMake(175,50) alignment:NSTextAlignmentCenter fontName:@"StencilRegular" fontSize:32];
playScene2Label.color = ccc3(0,0,0);
CCMenuItemLabel *playScene2 = [CCMenuItemLabel itemWithLabel:playScene2Label target:self selector:@selector(playScene:)];
[playScene2 setTag:2];
CCLabelTTF *playScene3Label = [CCLabelTTF labelWithString:@"See Mel Ride" dimensions:CGSizeMake(200,50) alignment:NSTextAlignmentCenter fontName:@"StencilRegular" fontSize:32];
playScene3Label.color = ccc3(0,0,0);
CCMenuItemLabel *playScene3 = [CCMenuItemLabel itemWithLabel:playScene3Label target:self selector:@selector(playScene:)];
[playScene3 setTag:3];
//CCLabelBMFont *playScene4Label = [CCLabelBMFont labelWithString:@"See Mel Vote" fntFile:@"Arial.fnt"];
CCLabelTTF *playScene4Label = [CCLabelTTF labelWithString:@"See Mel Vote" dimensions:CGSizeMake(200,50) alignment:NSTextAlignmentCenter fontName:@"StencilRegular" fontSize:32];
playScene4Label.color = ccc3(0,0,0);
CCMenuItemLabel *playScene4 = [CCMenuItemLabel itemWithLabel:playScene4Label target:self selector:@selector(playScene:)];
[playScene4 setTag:4];
//CCLabelBMFont *playScene5Label = [CCLabelBMFont labelWithString:@"Some other2" fntFile:@"Arial.fnt"];
CCLabelTTF *playScene5Label = [CCLabelTTF labelWithString:@"Credits" dimensions:CGSizeMake(100,50) alignment:NSTextAlignmentCenter fontName:@"StencilRegular" fontSize:32];
playScene5Label.color = ccc3(0,0,0);
CCMenuItemLabel *playScene5 = [CCMenuItemLabel itemWithLabel:playScene5Label target:self selector:@selector(playScene:)];
[playScene5 setTag:5];
//CCLabelBMFont *backButtonLabel = [CCLabelBMFont labelWithString:@"Back" fntFile:@"Arial.fnt"];
CCLabelTTF *backButtonLabel = [CCLabelTTF labelWithString:@"Back" dimensions:CGSizeMake(100,50) alignment:NSTextAlignmentCenter fontName:@"StencilRegular" fontSize:32];
backButtonLabel.color = ccc3(0,0,0);
CCMenuItemLabel *backButton = [CCMenuItemLabel itemWithLabel:backButtonLabel target:self selector:@selector(displayMainMenu)];
sceneSelectMenu = [CCMenu menuWithItems:playScene1, playScene2,playScene3,playScene4,playScene5,backButton,nil];
[sceneSelectMenu alignItemsVerticallyWithPadding:screenSize.height * 0.009f];
[sceneSelectMenu setPosition:ccp(screenSize.width * 2,screenSize.height / 2)];
id moveAction = [CCMoveTo actionWithDuration:0.5f position:ccp(screenSize.width * 0.75f,screenSize.height/2)];
id moveEffect = [CCEaseIn actionWithAction:moveAction rate:1.0f];
[sceneSelectMenu runAction:moveEffect];
[self addChild:sceneSelectMenu z:3 tag:kSceneMenuTagValue];
}
/**
# pragma mark - IAP methods
-(void)fetchIAPs{
_priceFormatter = [[NSNumberFormatter alloc] init];
[_priceFormatter setFormatterBehavior:NSNumberFormatterBehavior10_4];
[_priceFormatter setNumberStyle:NSNumberFormatterCurrencyStyle];
[self reload];
//self.refreshControl = [[UIRefreshControl alloc] init];
//[self.refreshControl addTarget:self action:@selector(reload) forControlEvents:UIControlEventValueChanged];
//[self reload];
//[self.refreshControl beginRefreshing];
}
- (void)reload {
_products = nil;
//[self.tableView reloadData];
[[MZIAPHelper sharedInstance] requestProductsWithCompletionHandler:^(BOOL success, NSArray *products) {
if (success) {
_products = products;
//[self.tableView reloadData];
}
//[self.refreshControl endRefreshing];
}];
NSLog(@"IAPProducts reloaded");
}
**/
# pragma mark - INIT
-(id)init {
if( (self=[super initWithColor:ccc4(255,255,255,255)]) ) {
}
return self;
}
-(void)onEnter {
[super onEnter];
[[GameManager sharedGameManager] playBackgroundTrack:BACKGROUND_TRACK_MAIN_MENU];
CGSize screenSize = [CCDirector sharedDirector].winSize;
//MAIN MENU
//RETINA TEST FIRST
if ([[UIScreen mainScreen]scale] == 1){
//NONRETINA CODE
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
CCSprite *background = nil;
background = [CCSprite spriteWithFile:@"MainMenu-iPad.png"];
[background setPosition:ccp(screenSize.width/2,screenSize.height/2)];
[self addChild:background];
[self displayMainMenu];
} else {
CCSprite *background = nil;
background = [CCSprite spriteWithFile:@"MainMenu.png"];
[background setPosition:ccp(screenSize.width/2,screenSize.height/2)];
[self addChild:background];
[self displayMainMenu];
}
} else if ([[UIScreen mainScreen]scale] == 2){
//RETINA CODE
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
CCSprite *background = nil;
background = [CCSprite spriteWithFile:@"MainMenu-iPad-hd.png"];
[background setPosition:ccp(screenSize.width/2,screenSize.height/2)];
[self addChild:background];
[self displayMainMenu];
} else {
CCSprite *background = nil;
background = [CCSprite spriteWithFile:@"MainMenu-hd.png"];
[background setPosition:ccp(screenSize.width/2,screenSize.height/2)];
[self addChild:background];
[self displayMainMenu];
}
}
//MAIN FIGURE
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
CCSprite *character = [CCSprite spriteWithFile:@"melzelaya-iPad.png"];
[character setPosition:ccp(screenSize.width * 0.25f, screenSize.height * 0.25f)];
[character setScale:0.8];
[self addChild:character];
id rotateAction = [CCEaseElasticInOut actionWithAction:[CCRotateBy actionWithDuration:5.5f angle:360]];
id scaleUp = [CCScaleTo actionWithDuration:2.0f scale:1.5f];
id scaleDown = [CCScaleTo actionWithDuration:2.0f scale:0.5f];
[character runAction:[CCRepeatForever actionWithAction:[CCSequence actions:scaleUp,scaleDown,nil]]];
[character runAction:[CCRepeatForever actionWithAction:rotateAction]];
} else {
CCSprite *character = [CCSprite spriteWithFile:@"melzelaya.png"];
[character setPosition:ccp(screenSize.width * 0.25f, screenSize.height * 0.25f)];
[character setScale:0.8];
[self addChild:character];
id rotateAction = [CCEaseElasticInOut actionWithAction:[CCRotateBy actionWithDuration:5.5f angle:360]];
id scaleUp = [CCScaleTo actionWithDuration:2.0f scale:1.5f];
id scaleDown = [CCScaleTo actionWithDuration:2.0f scale:0.5f];
[character runAction:[CCRepeatForever actionWithAction:[CCSequence actions:scaleUp,scaleDown,nil]]];
[character runAction:[CCRepeatForever actionWithAction:rotateAction]];
}
//get products from store
//[self fetchIAPs];
}
@end
//
// RootViewController.m
// MZ
//
// Created by Marcio Valenzuela on 7/11/11.
// Copyright Personal 2011. All rights reserved.
//
//
// RootViewController + iAd
// If you want to support iAd, use this class as the controller of your iAd
//
#import "cocos2d.h"
#import "RootViewController.h"
#import "GameConfig.h"
@implementation RootViewController
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
//
// There are 2 ways to support auto-rotation:
// - The OpenGL / cocos2d way
// - Faster, but doesn't rotate the UIKit objects
// - The ViewController way
// - A bit slower, but the UiKit objects are placed in the right place
//
#if GAME_AUTOROTATION==kGameAutorotationNone
//
// EAGLView won't be autorotated.
// Since this method should return YES in at least 1 orientation,
// we return YES only in the Portrait orientation
//
return ( interfaceOrientation == UIInterfaceOrientationPortrait );
#elif GAME_AUTOROTATION==kGameAutorotationCCDirector
//
// EAGLView will be rotated by cocos2d
//
// Sample: Autorotate only in landscape mode
//
if( interfaceOrientation == UIInterfaceOrientationLandscapeLeft ) {
[[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeRight];
} else if( interfaceOrientation == UIInterfaceOrientationLandscapeRight) {
[[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeLeft];
}
// Since this method should return YES in at least 1 orientation,
// we return YES only in the Portrait orientation
return ( interfaceOrientation == UIInterfaceOrientationPortrait );
#elif GAME_AUTOROTATION == kGameAutorotationUIViewController
//
// EAGLView will be rotated by the UIViewController
//
// Sample: Autorotate only in landscpe mode
//
// return YES for the supported orientations
return ( UIInterfaceOrientationIsLandscape( interfaceOrientation ) );
#else
#error Unknown value in GAME_AUTOROTATION
#endif // GAME_AUTOROTATION
// Shold not happen
return NO;
}
//
// This callback only will be called when GAME_AUTOROTATION == kGameAutorotationUIViewController
//
#if GAME_AUTOROTATION == kGameAutorotationUIViewController
-(void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration
{
//
// Assuming that the main window has the size of the screen
// BUG: This won't work if the EAGLView is not fullscreen
///
CGRect screenRect = [[UIScreen mainScreen] bounds];
CGRect rect = CGRectZero;
if(toInterfaceOrientation == UIInterfaceOrientationPortrait || toInterfaceOrientation == UIInterfaceOrientationPortraitUpsideDown)
rect = screenRect;
else if(toInterfaceOrientation == UIInterfaceOrientationLandscapeLeft || toInterfaceOrientation == UIInterfaceOrientationLandscapeRight)
rect.size = CGSizeMake( screenRect.size.height, screenRect.size.width );
CCDirector *director = [CCDirector sharedDirector];
EAGLView *glView = [director openGLView];
float contentScaleFactor = [director contentScaleFactor];
if( contentScaleFactor != 1 ) {
rect.size.width *= contentScaleFactor;
rect.size.height *= contentScaleFactor;
}
glView.frame = rect;
}
#endif // GAME_AUTOROTATION == kGameAutorotationUIViewController
- (void)didReceiveMemoryWarning {
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren't in use.
}
- (void)viewDidUnload {
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
- (void)dealloc {
[super dealloc];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment