ios5,cocos2d-iphoneRelated issues-Collection of common programming errors


  • user1529412
    ios5 uiview uitableviewcontroller pushviewcontroller viewdidload
    I created UIExamsTVC using storyboards.Once cell is clicked, it takes me to UITestVC.UITestVC has 10 questions, When I get to the last question #10, there I have a “Done” button. I would like to go back to the original UIExamsTVC once the ‘Done’ button Clicked.In: UITestVC.m#import UIExamsTVC.h(on button click)[self.navigationController pushViewController:UIExamsTVC animated:NO];Compile error – Unexpected Interface nameHow can I do this?

  • Girish
    ios objective-c ios5 login uiwebview
    I want to have present a UIWebView with a login screen for a user to login to a service, and once they are properly logged in, I want to scrape the page for content. How do I figure out when they logged in to the service?I know I could check the current URL, as it redirects to a specific, easy to identify URL, but at the same time, if they somehow navigated around the web until they came across this link and clicked on it, it would have unexpected results in my app.

  • Slinky
    uitableview ios5 pushviewcontroller nsindexpath
    I now know that If you push a view controller onto a navigation controller with animation, you must wait until that animation has completed before pushing another view controller otherwise you get warnings and possibly unexpected results.How do you check to see if the nav controller animation has completed such to avoid this issue?Thanks- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath: (NSIndexPath *)indexPath { // …//Make sure animation has completed before sending messag

  • vigneshvelsubbu
    ios5 restkit cocoapods
    i am using Restkit for webservice client in ios application..i used cocoapods to install the restkit in my sample project.But it is giving semantic issue,and parsing errors when i am building..is there anyone help to solve this issue.i used this link to install Restkit using cocoapodshttps://github.com/RestKit/RestKit/wiki/Installing-restkit-v0.20.x-via-cocoapodserrors are like this/RKHTTPUtilities.m:69:40: error: unexpected ‘@’ in programstatusCodesToNamesDictionary = @{/ObjectMapping/RKHTTPUti

  • Micah Hainline
    iphone ios ios5 ocmock
    I have some simple mock objects with some stubs and expectations set up. When I run my tests on the iOS 4.3 simulator, everything passes. When I run on iOS 5, I get “unexpected method invoked” failures. As an example case, I have a method – (void) foo: (NSString *) bar that I set up an expectation for and then run. The result is unexpected method invoked: foo:@”foobar” expected: foo:@”foobar”Any one know why this is happening, or how to fix it? The tests themselves are perfectly fine, and h

  • Howard Spear
    ios5 uiview uiviewcontroller
    I have a UINavigationController with a number of child view controllers, some of which are container controllers. The UIView frame layout of the last added child UIViewController (green background) has its parent background (yellow) through when it should not. How can I layout everything so all of the views fit within the bounds of the screen below the Navigation bar without the weird offset? UIViewController hierarchy, started in my AppDelegate:UINavigationController rootViewController:FrontFac

  • Teo Sartori
    ios splash-screen storyboard ios5
    I have been trying to understand why my modally presented image is not being shown underlaid the transparent status bar. The _window.rootViewController is a UILayoutContainerView, part of the Tab view that is the first responder view defined in the Storyboard.When the presentViewController message is sent to the rootViewController i can see in the call stack thatUIWindowController transition:fromViewController:toViewController:target:didEndSelector:calls the setFrame of my coverImageViewControll

  • Artemix
    xcode ios5 profile xcode4.5
    I have a project that I refactored for iOS 5 and ARC. It builds and runs fine, Analyzer finds nothing and I’m on the brink of submitting it to the App store. Before doing that, I thought it would be a good idea to check for leaks, just in case I missed something during the arcification. However when I choose “Product -> Profile” from the XCode 4.5 menu I get a flood of warnings and errors. All of them indicate that the build for profiling is not recognizing that the project is using ARC. The sch

  • SNR
    ios ios5 calendar core-foundation ios5.1
    I am getting a strange problem in iOS 5.0 (9A334). The problem is I use CFCalendarGetOrdinalityOfUnit to get the day of week for a particular date. CFCalendarRef theCalendar = CFCalendarCopyCurrent(); CFAbsoluteTime newTime = 0; const char format[] = “yMdHms”; CFCalendarComposeAbsoluteTime (theCalendar,&newTime,format,theYear, theMonth,theDay, 0, 0, 0); NSInteger lastDayOfWeekInPreviousMonth = CFCalendarGetOrdinalityOfUnit (calendar,kCFCalendarUnitDay,kCFCalendarUnitWeek,absTime );It returns

  • fibnochi
    iphone ios5 core-graphics xcode4.3 quartz-graphics
    I’m trying to draw a L shape, the code works but the lines are not of the right width and is 5 pixels thick for vertical lines and some are 3 pixels thick despite me explicitly telling it to use 3 pixel as line width,what am I doing wrong? here’s my code:CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextClearRect(ctx, rect); CGContextAddPath(ctx, pathi); CGContextSetStrokeColorWithColor(ctx, [UIColor redColor].CGColor); CGContextSetLineWidth(ctx, 3.0); CGContextSetLineCap(ctx, kCGLineCa

  • 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

  • Lana Miller
    iphone c cocos2d-iphone va-arg va-list
    I’m having a hell of a time with the CCMenu class. To create a menu with this class it forces you to call a method called initWithItems, which takes a va_list. I need to generate this list at runtime, and I read that creating a C array and passing that can function just as va_list does under the covers, only it is failing.I have an NSArray of items I want in the va_list, and these items are a SUBCLASS of CCMenuItem, the class that menuWithItems is expecting in the va_list. If you hardcode this l

Web site is in building