ios6,cocos2d-iphone,sprite-sheetRelated issues-Collection of common programming errors


  • Tullio Onion Sebastiani
    iphone objective-c ios6 storyboard navigationcontroller
    I’m developing an iOS6 App with storyboards and i’m encountering an unexpected beahviour. My app is almost in portrait mode , and i would keep this orientation in all the views except two.For this reason the project supports both landscape and portrait mode, i’ve subclassed navigation controller with a category (as explained almost everywhere :-)in Appdelegate.m and every view controller implements – (NSUInteger)supportedInterfaceOrientations{return UIInterfaceOrientationMaskPortrait; (landscap

  • Lukas Kukacka
    ios6 storyboard autolayout
    I am struggling with Autolayout (using it for the first time in a new app).Following situation:Storyboard iPad Autolayout enabledIn one Popover I need to re-layout 8 buttons programmatically according to user-selection. This works fine until the moment where the buttons must be rotated by 180° (to be viewed upside down, which is an app feature).As soon as I add the code for the rotation, the relayout does not work anymore. I don’t understand why I can change the position of the buttons (like Cas

  • Aitul
    ios6 game-center invitation
    I am developing a turn based game using the Game Center. I handle the invitations to play using the following code::GKMatchmaker sharedMatchmaker].inviteHandler = ^(GKInvite* acceptedInvite, NSArray *playersToInvite){if(acceptedInvite != nil){// Get a match for the invite we obtained…NSLog(@”Valor de la invitacion %@”,acceptedInvite);[[GKMatchmaker sharedMatchmaker] matchForInvite:acceptedInvite completionHandler:^(GKMatch *match, NSError *error){if(match != nil){NSLog(@”match != nil: “);}else

  • poupou
    xcode mono monotouch monodevelop ios6
    I have a problem building my app on MonoTouch and iOS 6.My system configuration is:Mac OSX 10.7.4 (Lion) MonoTouch 5.2.13 MonoDevelop 3.0.3.5 XCode 4.5 with iOS 6 SDK beta 4.To link new iOS SDK I have selected on MonoDevelop preference SDK location (for me it’s on desktop) and i have restarted it.Now, when I try to build my application, MonoDevelop gives me following error:Unexpected error – Please fill a bug report athttp://bugzilla.xamarin.com (MT0000) Can anyone help me to understand what is

  • Bacalso Vincent
    ios svn ios6 cocoapods xcode4.6.2
    So we decided to integrate cocoapods in our existing project which is under SVN. My teammate had successfully setup it and he can just build the project just fine.But when I checked-out the project and did a pod install, this what happens:Analyzing dependencies Downloading dependencies Using ASIHTTPRequest (1.8.1) Using Base64nl (1.1) Installing Facebook-iOS-SDK (3.7.1) [!] Pod::Executable clone ‘/Users/me/Library/Caches/CocoaPods/GitHub/2cdc3c53ee617444d0d6cd7730e598cd77a19eb2’ ‘/Users/me/Desk

  • SpaceBeers
    iphone mapkit ios6 ios6-maps
    My understanding was there was no problems moving to iOS 6 maps. But for some reason, the Detail Disclosure Button is now MISSING in my map App. Is there a way to get this back. Wow, totally unexpected. This has been working for years, so all delegates are fine.#pragma mark MKMapViewDelegate – (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation {MKPinAnnotationView *pin = [[[MKPinAnnotationView alloc] initWithAnnotation:annotation reuseIdentifi

  • NSUserDefault
    iphone uinavigationcontroller ios6 uiinterfaceorientation
    I created an app in ios 6 with navigation view.Also I have set all orientation options in the application summary and even used the-(BOOL) shouldAutoRotateand -(NSUInteger) supportedInterfaceOrientaionmethods in my view controller.when I run my app orientation works fine except upside-down.What should I do to also support upside-down.I also facing the same problem when I add UITabBar controller.Please share your ideas.Thank you

  • mattkc7
    ios xcode ios6 ios-simulator xcode4.5
    I’m making an iPad app and it runs on the simulator, but fails when i try building it for the device. the error is below:These are the things i’ve tried to rectify this issue:went through every PNG file with Photoshop and saved them again w/o the interlace Deleted all the images in my Resources folder and added them again by dragging/dropping the images again Deleted ALL PNG images (left the JPGs) and it works…when i add one PNG, Xcode throws a hissy fit. Deleted the derivedData in my ~Library

  • iPatel
    ios objective-c xcode ios6
    I am getting this warning in Xcode…plz give me idea to solve this warning issueUsing the font Tahoma in versions of Xcode prior to 4.2 may have unexpected results.iOS

  • shawnwall
    objective-c ios6 uiappearance
    Below code is perfectly working fine iOS 5, but not on iOS 6 or above. What I want that for Email composer sheet the navigationBar image will be different then other UINavigationBar classes. I can’t understand that debug pointer is responding the appearance method but on device it shows navigationBar image as “bgNavigationBar.png”; expected is “bgNavigationBar_2.png”.Please guide me…….if ([[UINavigationBar class]respondsToSelector:@selector(appearance)]) {UIImage *logoImage44 = [[UIImage im

  • kender
    iphone cocoa-touch memory-management cocos2d-iphone
    I have an iPhone application in Cocos2d that sometimes crashes on actual device, due to memory problems. What I have so far found out is that the scenes, when switched, aren’t fully released – the [retainCount] for them is somewhat about 4-10 🙂 The dealloc method never gets called, and then I assume, when I switch the scenes a few times, the memory issue shows up. I’m wondering – where should I relese the scene? Since it has number of children, I suppose I should be doing a cleanup-removal of t

  • LearnCocos2D
    cocos2d-iphone uialertview
    I am trying to lay buttons on top of a background image for a UIAlertView in Cocos2d. Its not working with the code below. any suggestions?UIAlertView *Win=[[UIAlertView alloc] initWithTitle:@”You Win” message:nil delegate:self cancelButtonTitle:@”Next” otherButtonTitles:@”Replay”,@”Quit”, nil];UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(-50, -30, 400, 300)];NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathCom

  • White Money
    iphone cocos2d cocos2d-iphone
    I’m wonderring that what’s the difference between ccTouchesCancelled and ccTouchesEnded events in Cocos2d?Thanks! Tien

  • OpenLearner
    cocos2d-iphone cocos2d
    I have a simple CCRotateBy action in a sequence; it is followed by a call to another method which confirms that the CCRotateBy completed (otherwise, that CCCallFunc would not get called in the sequence if CCRotateBy didn’t complete):-(void)correctRotation{if (self.rotationAmount){CCLOG(@”correcting rotation inside: %i”,self.buildNum);CCRotateBy*second=[CCRotateBy actionWithDuration:1 angle:-self.rotationAmount];CCEaseBackInOut*bounce2=[CCEaseBackInOut actionWithAction:second];CCCallFunc*func=[CC

  • 25 revs, 2 users 100%Lukasz
    iphone cocos2d-iphone opengl-es-2.0 alpha blending
    I have very simple CCScene with ONLY 1 CCLayer containing:CCSprite for background with standard blending mode CCRenderTexture to draw paint brushes, with its sprite attached to root CCLayer above background sprite:_bgSprite = [CCSprite spriteWithFile:backgroundPath]; _renderTexture = [CCRenderTexture renderTextureWithWidth:self.contentSize.width height:self.contentSize.height]; [_renderTexture.sprite setBlendFunc:(ccBlendFunc){GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA}]; [self addChild:_bgSprite z:-1

  • Geoffroy
    c++ cocos2d-iphone copywithzone
    I have some trouble.I made some interface (abstract class in c++). Implemented it in my class (derived from CCObject too). In third class I try to invoke method of interface and got SIGABORT. Here the code//interface classclass CallBackInterface{public:virtual void SomeMethod() = 0;};//my class that implement the interface class MyClass : public CallBackInterface, public CCObject{public:void SomeMethod(){/*some realization*/}; };//class that invoke the SomeMethodclass CallBacker(){public:CallBa

  • Mason
    ios cocos2d-iphone
    I think I might be causing a bug in my code because I’m unclear about what the cleanup: part of removeChild:cleanup: method of cocos2d ccnode class.Thanks.

  • oopology
    objective-c cocos2d-iphone nsarray
    What are the differences between NSArray and CCArray? Also, in what cases will one be preferred to the other with respect to game programming?

  • Sushi Ninja
    ios cocos2d-iphone
    I’m currently trying to create an endlessly scrolling background with a character who jumps up and down and collects items that come along the way. My problem lies with the items that need to be created and then moved.I’ve looked at CCSpriteBatchNode and NSMutableArray but I’m not sure which to use.I reviewed Steffen Itterheim’s example from his book regarding creating bullets while initializing and then using them when needed. I thought that this would be inefficient and taxing on the iPhone. A

  • Just Kidding
    objective-c cocos2d-iphone
    I’m using a Objective-C framework for game development called Cocos2d-iphone.This is how I create a button-graphic in the game:CCMenuItemImage *battle;battle = [CCMenuItemImage itemFromNormalImage:@”BattleFightOption1.png” selectedImage:@”BattleFightOption2.png”target:self selector:@selector(battleFightOption)];Basically, when the user clicks the button, method battleFightOption runs.But I wonder, I never did define battleFightOption in the interface.. so, my question is: when is it necessary to

  • hemant
    ios cocos2d-iphone sprite-sheet texturepacker
    I am animating a whole body through SpriteSheets with CCSpriteBatchNode and CCSpriteFrameCache. Now user can add his own pic to that body which when i try to addChild to Spritesheet crashes with error “CCSprite is not using the same texture id” Now i know the face CCSprite was not in that cache/texture(it was created through texturepacker) and the crash was normal but i wanted to know if there was a workaround to this as i have to add a face to that body through user interaction and animate that

  • KsK
    ios6 cocos2d-iphone sprite-sheet
    I have create a sprite sheet for non retina display and its working fine on simulator.. I have used the code -(Void)addSprites{[[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@”image.plist”];CCSpriteBatchNode *spriteSheet = [CCSpriteBatchNode batchNodeWithFile:@”image.png”];[self addChild:spriteSheet];// Load up the frames of our animationNSMutableArray *walkAnimFrames = [NSMutableArray array];for(int i = 1; i < 5; i++) {[walkAnimFrames addObject:[[CCSpriteFrameCache sha

  • Scott Pfeil
    iphone cocos2d cocos2d-iphone sprite sprite-sheet
    I’m trying to use more than one sprite sheet because I can’t fit them all on one and having two makes my ordering them easier (sprite sheet one sprites are in the back and have a lower zOrder). I’m currently doing:spriteSheet1 = [[CCSpriteSheet spriteSheetWithFile:@”spriteSheet1.png” capacity:3] retain]; [[CCSpriteFrameCache sharedSpriteFrameCache] addSpriteFramesWithFile:@”spriteSheet1.plist”]; [self addChild:spriteSheet1];spriteSheet2 = [[CCSpriteSheet spriteSheetWithFile:@”spriteSheet2.pn

Web site is in building