{"id":3135,"date":"2014-03-16T22:56:37","date_gmt":"2014-03-16T22:56:37","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/ios5cocos2d-iphonerelated-issues-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:42:28","modified_gmt":"2022-08-30T15:42:28","slug":"ios5cocos2d-iphonerelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/16\/ios5cocos2d-iphonerelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"ios5,cocos2d-iphoneRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/33bb2f592b9463b9107167f8f1a292a3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser1529412<br \/>\nios5 uiview uitableviewcontroller pushviewcontroller viewdidload<br \/>\nI 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 &#8220;Done&#8221; button. I would like to go back to the original UIExamsTVC once the &#8216;Done&#8217; button Clicked.In: UITestVC.m#import UIExamsTVC.h(on button click)[self.navigationController pushViewController:UIExamsTVC animated:NO];Compile error &#8211; Unexpected Interface nameHow can I do this?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7fd6c750a98b6aaa10ab273995aa741f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGirish<br \/>\nios objective-c ios5 login uiwebview<br \/>\nI 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.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f7742b7d6787ae672a59adc841aab728?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSlinky<br \/>\nuitableview ios5 pushviewcontroller nsindexpath<br \/>\nI 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 { \/\/ &#8230;\/\/Make sure animation has completed before sending messag<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/38b1681fea72a094d03be56f6e45cbac?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nvigneshvelsubbu<br \/>\nios5 restkit cocoapods<br \/>\ni 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 &#8216;@&#8217; in programstatusCodesToNamesDictionary = @{\/ObjectMapping\/RKHTTPUti<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/28a13404c629a772e5171341e6a1f23e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMicah Hainline<br \/>\niphone ios ios5 ocmock<br \/>\nI 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 &#8220;unexpected method invoked&#8221; failures. As an example case, I have a method &#8211; (void) foo: (NSString *) bar that I set up an expectation for and then run. The result is unexpected method invoked: foo:@&#8221;foobar&#8221; expected: foo:@&#8221;foobar&#8221;Any one know why this is happening, or how to fix it? The tests themselves are perfectly fine, and h<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/effd069aaef37166bcea10e5a1f17608?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nHoward Spear<br \/>\nios5 uiview uiviewcontroller<br \/>\nI 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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/4V7Y4.jpg?s=32&amp;g=1\" \/><br \/>\nTeo Sartori<br \/>\nios splash-screen storyboard ios5<br \/>\nI 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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/bd8b594a08d8dee3f87dc4469bdf089c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nArtemix<br \/>\nxcode ios5 profile xcode4.5<br \/>\nI have a project that I refactored for iOS 5 and ARC. It builds and runs fine, Analyzer finds nothing and I&#8217;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 &#8220;Product -&gt; Profile&#8221; 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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/803bc50c7094481aae03fed1cc3ae1fc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSNR<br \/>\nios ios5 calendar core-foundation ios5.1<br \/>\nI 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[] = &#8220;yMdHms&#8221;; CFCalendarComposeAbsoluteTime (theCalendar,&amp;newTime,format,theYear, theMonth,theDay, 0, 0, 0); NSInteger lastDayOfWeekInPreviousMonth = CFCalendarGetOrdinalityOfUnit (calendar,kCFCalendarUnitDay,kCFCalendarUnitWeek,absTime );It returns<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/711cfa3017285a9a02bc3e53292b432c?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nfibnochi<br \/>\niphone ios5 core-graphics xcode4.3 quartz-graphics<br \/>\nI&#8217;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&#8217;s my code:CGContextRef ctx = UIGraphicsGetCurrentContext(); CGContextClearRect(ctx, rect); CGContextAddPath(ctx, pathi); CGContextSetStrokeColorWithColor(ctx, [UIColor redColor].CGColor); CGContextSetLineWidth(ctx, 3.0); CGContextSetLineCap(ctx, kCGLineCa<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/996952de195a8bc83b2421e49a754e7d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLearnCocos2D<br \/>\ncocos2d-iphone uialertview<br \/>\nI 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:@&#8221;You Win&#8221; message:nil delegate:self cancelButtonTitle:@&#8221;Next&#8221; otherButtonTitles:@&#8221;Replay&#8221;,@&#8221;Quit&#8221;, nil];UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(-50, -30, 400, 300)];NSString *path = [[NSString alloc] initWithString:[[[NSBundle mainBundle] resourcePath] stringByAppendingPathCom<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/09c3d801fb82afdfd7e2715d95e1bab5?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWhite Money<br \/>\niphone cocos2d cocos2d-iphone<br \/>\nI&#8217;m wonderring that what&#8217;s the difference between ccTouchesCancelled and ccTouchesEnded events in Cocos2d?Thanks! Tien<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/pJmdo.jpg?s=32&amp;g=1\" \/><br \/>\nOpenLearner<br \/>\ncocos2d-iphone cocos2d<br \/>\nI 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&#8217;t complete):-(void)correctRotation{if (self.rotationAmount){CCLOG(@&#8221;correcting rotation inside: %i&#8221;,self.buildNum);CCRotateBy*second=[CCRotateBy actionWithDuration:1 angle:-self.rotationAmount];CCEaseBackInOut*bounce2=[CCEaseBackInOut actionWithAction:second];CCCallFunc*func=[CC<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/Y6tnm.png?s=32&amp;g=1\" \/><br \/>\n25 revs, 2 users 100%Lukasz<br \/>\niphone cocos2d-iphone opengl-es-2.0 alpha blending<br \/>\nI 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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/7f4ee98206d84b25a83228e285c678f0?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGeoffroy<br \/>\nc++ cocos2d-iphone copywithzone<br \/>\nI 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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dea18ef2f45c722dba24e63a992825ed?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMason<br \/>\nios cocos2d-iphone<br \/>\nI think I might be causing a bug in my code because I&#8217;m unclear about what the cleanup: part of removeChild:cleanup: method of cocos2d ccnode class.Thanks.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3af3b1eaf4a5e968bcc96bc70841bbfb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\noopology<br \/>\nobjective-c cocos2d-iphone nsarray<br \/>\nWhat are the differences between NSArray and CCArray? Also, in what cases will one be preferred to the other with respect to game programming?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f21a1cddb3764e27fa69a5cb8ca3d03d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nSushi Ninja<br \/>\nios cocos2d-iphone<br \/>\nI&#8217;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&#8217;ve looked at CCSpriteBatchNode and NSMutableArray but I&#8217;m not sure which to use.I reviewed Steffen Itterheim&#8217;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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/808ba667d45cea35164ec83de49b0de8?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJust Kidding<br \/>\nobjective-c cocos2d-iphone<br \/>\nI&#8217;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:@&#8221;BattleFightOption1.png&#8221; selectedImage:@&#8221;BattleFightOption2.png&#8221;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<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/1e9927d112dc22217814620bcdd2d66f?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nLana Miller<br \/>\niphone c cocos2d-iphone va-arg va-list<br \/>\nI&#8217;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<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n","protected":false},"excerpt":{"rendered":"<p>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 &#8220;Done&#8221; button. I would like to go back to the original UIExamsTVC once the &#8216;Done&#8217; button Clicked.In: UITestVC.m#import UIExamsTVC.h(on button click)[self.navigationController [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4,1],"tags":[],"class_list":["post-3135","post","type-post","status-publish","format-standard","hentry","category-semantic","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3135","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3135"}],"version-history":[{"count":1,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3135\/revisions"}],"predecessor-version":[{"id":8799,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3135\/revisions\/8799"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3135"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3135"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3135"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}