{"id":7147,"date":"2014-05-26T00:44:46","date_gmt":"2014-05-26T00:44:46","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/05\/26\/ioscocos2d-iphonedidreceivememorywarningcctexturecacherelated-issues-collection-of-common-programming-errors\/"},"modified":"2014-05-26T00:44:46","modified_gmt":"2014-05-26T00:44:46","slug":"ioscocos2d-iphonedidreceivememorywarningcctexturecacherelated-issues-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/05\/26\/ioscocos2d-iphonedidreceivememorywarningcctexturecacherelated-issues-collection-of-common-programming-errors\/","title":{"rendered":"ios,cocos2d-iphone,didreceivememorywarning,cctexturecacheRelated issues-Collection of common programming errors"},"content":{"rendered":"<ul>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cb791c8f12e687d3538677321cdc8d2a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDaniel<br \/>\nios memory-management xcode5<br \/>\nI am new to Objective C so this code is probably not written that well. When the app is launched, it calls the following code if it has not been saved into the phone yet. When it starts to loop through the while loop, the app crashes on any phone the is not the iphone 5s. I think this is due to the memory usage. I believe that inside the while loop, when the NSMutableString (movieTitle) is created, is where the memory spike is. I should also add that the amount of times the loop is iterated is a<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3158acca2b83111622b590c4b8f3cd2d?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nuser2541100<br \/>\nios audiounit<br \/>\nI am playing sound file(.caf) that play and make sine waves like audiounit and augraph works. It is playing fine and showing sine waves perfectly in simulator. But when i run it on iPad it is not working(no sound and no waves).I have tried many things but nothing works. But i do analyse one thing that when i run it on simulator Bool value is Stereo is Yes.But when it runs on iPad is Stereo becomes NO and number of channels becomes 1 from 2.Any help would be appreciated.My code is -static OSStatu<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/0263c4c9036955a2d9768bf6a35a8345?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nKara<br \/>\nios xcode core-data memory<br \/>\nWith my App I have a pre-populated sqlite DB that I created using core data from another app I created so the Data model is the same. I copy it over and everything works great. I tried it on every iOS device that can run iOS 6.0 because that is what I am building for. Even on the early iPod Touches the App works. It takes around 45 secs for the DB to copy over on the older devices. The app works all the data is there and all devices the tests were great and no issues. I released the app on<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/943fe748f9902ced31e983c13f356e64?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRicardo Cerqueira<br \/>\nios xcode crash cocos2d adhoc<br \/>\nmy app runs fine on development mode, but for some reason on ad hoc i get a crash right after loading screen.I really can&#8217;t understand what could be wrong, any tips on how to test it better?Apple rejected it with this message:We found that your app failed to launch on an iPhone 5 and iPad 3rd gen running iOS 6.1.3, on both Wi-Fi and cellular networks.We encountered the issue when selecting the application on the Home screen &#8211; the app displayed a launch image then quit unexpectedly. This may be b<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8fff58d9d1012e7c2b0e1a2589c2ca7e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDavoda<br \/>\nios objective-c facebook-graph-api facebook-ios-sdk<br \/>\nI have a token but keep getting this error: &#8220;An active access token must be used to query information about the current user.&#8221; Any help is appreciated \ud83d\ude42 NSLog(@&#8221;TOKEN : %@&#8221;,[[FBSession activeSession] accessToken]);NSString *picture = [NSString stringWithFormat:@&#8221;http:\/\/www.prowebdev.org\/WooF\/API\/OpenGraph.php&#8221;];NSString *image = [NSString stringWithFormat:@&#8221;http:\/\/www.prowebdev.org\/WooF\/API\/upload\/356.jpg&#8221;];NSString *imageBool = [NSString stringWithFormat:@&#8221;true&#8221;];NSMutableDictionary *myDiction<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/99BBZ.jpg?s=32&amp;g=1\" \/><br \/>\nzakishaheen<br \/>\nios crash google-analytics crash-reports<br \/>\nI get the following crash (0x8badf00d) because of something to do with Google Analytics SDK 1.1. What&#8217;s also strange is that iOS killed it in just 1 second?I initialize the tracker like this:[[GANTracker sharedTracker] startTrackerWithAccountID:kGANWebPropertyID dispatchPeriod:kGANDispatchPeriodSec delegate:self];Here is the crash logIncident Identifier: 5459E916-5306-408A-A630-F405DFD97711 CrashReporter Key: 20ac546c31144c5f86de428ce3332012ab604d49 Hardware Model: iPhone3,1 Process:<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/a44892290364a20f0c29f5c27d419009?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nraulCab<br \/>\nios<br \/>\nI am building an app that send data when the user enters in the background. It also uses geofencing. When the user enters or exits a geofence I call an API. Sometimes when I open the app from the background it just shows a black screen and it is completely frozen. I have to kill it and start it again.I think the issue is when I call the API when the user enters the background. In the applicationDidEnterBackground I am calling a method call createJSON:NSData *jsonData = [NSJSONSerialization data<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6c4422458e08fd9aeb96bcc4001bb8e3?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nBen L.<br \/>\nios core-data crash game-center gamekit<br \/>\nI have an iOS app that consistently crashes when you try to delete a GKTurnBasedMatch using [match removeWithCompletionHandler:^(NSError *error){}];When the completion handler is called, error is nil, meaning that it successfully deleted the match. The match does get deleted (it never re-appears), but at the same time, gamed (the background daemon written by apple that communicates with GameCenter servers) crashes. Here is what I see in the Console when I delete a game:Jan 19 20:47:22 Ben-L-iPho<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/4e497767d0a1523c9afbbe2722a73523?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nRakhe Kara<br \/>\nios iphone objective-c cocoa-touch<br \/>\nActually this crash is not reproducing every time, even not frequently but we got this crash in our production app. I am not sure where is the problem. It is telling crash is happening in thread 4 in Environments class line number 38.Code:NSBundle* bundle = [NSBundle mainBundle];NSString* envsPListPath = [bundle pathForResource:@&#8221;Environment&#8221; ofType:@&#8221;plist&#8221;];Line 38: NSDictionary *environments = [[NSDictionary alloc] initWithContentsOfFile:envsPListPath];But according to exception type:00000020<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/6f5e4631aece4ed851f4f4e621886072?s=32&amp;d=identicon&amp;r=PG&amp;f=1\" \/><br \/>\nSean Freitag<br \/>\nios xcode xctest<br \/>\nWhen running integration tests w\/ live requests against a server, sometimes I get the following crash. Does anyone have an idea why?I&#8217;m currently on OS X Mavericks and running these tests on the iOS 7.0.3 SDK and Jenkins.2014-01-23 14:55:47.178 xctest[74229:303] 200 &lt;- https:\/\/site\/30012.zipjson?deltadate=2014-02-22T16%3A31%3A56.000Z&amp;encrypt=N 2014-01-23 14:55:47.186 xctest[74229:303] GET -&gt; https:\/\/site\/30012.zipjson?deltadate=2014-02-22T16%3A31%3A56.000Z&amp;encrypt=N 2014-01-23 14:5<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/3a506e3d5853364fcfd5b3d473daf7c4?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nWaneck<br \/>\niphone ios opengl-es cocos2d-iphone antialiasing<br \/>\nI am new to opengl programming, but I am doing something very basic, and the difference of quality between a custom opengl code and cocos2d is huge!I am trying just to load an image and continuously rotate it every frame. With my code, I get a lot of flickering, sharp edges, while cocos2d has it all nice and smooth. I&#8217;ve set up 4x Multi-Sampling Anti-Aliasing using apple&#8217;s recommended code for iOs 4 on my code, and still it looks very bad in comparison to cocos2d without any MSAA.You can see the<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/81d2c0d1e169fccb63893706ef70db19?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nrmaddy<br \/>\nxcode opengl-es cocos2d-iphone<br \/>\nI&#8217;ve created an iPhone game which utilizes some code from an old version of the Cocos2D iPhone game development framework and I&#8217;ve got a wee bit of a problem running it on iOS 7.The version of Cocos2d from which the code was used was probably 0.98.The actual class is called QuadParticleSystem (in newer versions it&#8217;s been deprecated by CCParticleSystemQuad).The actual issue is that the game runs fine on iOS 6 and below. It even runs fine on iOS 7 if the deployment target is set to iOS 6.0 and SDK<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/dae907d26dd200d065227e2a020bc999?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nStephane Delcroix<br \/>\ncocos2d-iphone monotouch xamarin.ios<br \/>\nI have an issue when I subclass a type which bind an obj-C type. In some cases, it fails at construction time.I can reproduce this right now with the cocos2d bindings and CCSprite. Here&#8217;s my subclasspublic class MySprite : CCSprite {public MySprite (string filename) : base (filename){} }When I instantiate it, it fails:Stacktrace:at (wrapper managed-to-native) MonoTouch.ObjCRuntime.Messaging.void_objc_msgSendSuper_IntPtr (intptr,intptr,intptr) &lt;IL 0x00025, 0xffffffff&gt;at MonoTouch.Cocos2D.CC<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/60f488d7baa5fdcb7dd19dadf3686e35?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\ndropcode<br \/>\nc++ cocos2d-iphone box2d box2d-iphone<br \/>\nI don&#8217;t know much C++ and I am trying to implement a solution I found &#8211; (Getting the world&#8217;s contactListener in Box2D) using Cocos2d-box2d. Here is the Contact Listener.SubcContactListener.h:#import &lt;Foundation\/Foundation.h&gt; #import &#8220;cocos2d.h&#8221; #import &#8220;Box2D.h&#8221; #import &lt;vector&gt; typedef std::pair&lt;b2Fixture*, b2Fixture*&gt; fixturePair; typedef std::vector&lt;fixturePair&gt; thingsThatTouched;extern thingsThatTouched g_touchingFixtures;class SubcContactListener : public b2ContactLi<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/f67f5c1f611bd37a092285876ba5f7fb?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nJames Webster<br \/>\ncocos2d-iphone callback game-physics chipmunk<br \/>\nI\u2019m using Cocos2d v3 and want to change a body from dynamic to static after colliding with another body. At the moment I\u2019ve got:-(void)ccPhysicsCollisionPostSolve:(CCPhysicsCollisionPair *)pair static:(CCNode *)nodeA wildcard:(CCNode *)nodeB {_player.physicsBody.type = CCPhysicsBodyTypeStatic; }or-(BOOL)ccPhysicsCollisionPreSolve:(CCPhysicsCollisionPair *)pair static:(CCNode *)nodeA wildcard:(CCNode *)nodeB {_player.physicsBody.type = CCPhysicsBodyTypeStatic;return YES; }but neither works. I get<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b3e4dd7c5432a1c61160d1b9b87399ff?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGuru<br \/>\nobjective-c cocos2d-iphone core-audio simpleaudioengine<br \/>\nI read about preloading sounds in SimpleAudioEngine through [[SimpleAudioEngine sharedEngine] preloadEffect:@&#8221;bell.wav&#8221;];But, with this there are memory leaks which I read on couple of sites. On some websites it was used like this: &#8211;(void)loadSoundFilesInBackground {NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];[[SimpleAudioEngine sharedEngine] preloadEffect:@&#8221;bell.wav&#8221;];[pool release]; }What is the best way to load sound files in background through SimpleAudioEngine ? What is the<\/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 \/>\ncocos2d-iphone<br \/>\ncocos2d-iphone 1.0.1.I have noticed this with other cocos2d-iphone games installed in my device, like Kingdom Rush.Basically, most of the times, the audio is fine (almost always). But suddenly, at an unexpected moment, the background music stops playing and only the sound effects work. Sometimes, killing the application will not be enough to fix it.With my cocos2d-iphone game this happens as well, with no hint in the console. I use SimpleAudioEngine to play background music and sound effects.Kil<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/8d63368d48ce7cd63f3be1eeced67d37?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nTiddly<br \/>\niphone ios cocos2d-iphone cocos2d<br \/>\nI&#8217;m using cocos2d for iOS. Not sure if I&#8217;m doing something wrong here or if CCParallaxNode does something strange that I just don&#8217;t understand.I&#8217;m trying to create a few layers of parallax scrolling in the background of my game, at the moment I just have one layer added to the parallax node till I can figure out what&#8217;s going wrong. When the game loads the layer it&#8217;s always offset down and left by about 30% of the image size. I&#8217;ve uploaded an image demonstrating the difference in position here ht<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/32cdc777a19a6f2b2129decd30061cd1?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nkender<br \/>\niphone cocoa-touch memory-management cocos2d-iphone<br \/>\nI 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&#8217;t fully released &#8211; the [retainCount] for them is somewhat about 4-10 \ud83d\ude42 The dealloc method never gets called, and then I assume, when I switch the scenes a few times, the memory issue shows up. I&#8217;m wondering &#8211; where should I relese the scene? Since it has number of children, I suppose I should be doing a cleanup-removal of t<\/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:\/\/i.stack.imgur.com\/5zLYv.png?s=32&amp;g=1\" \/><br \/>\ncheeesus<br \/>\nobjective-c uiviewcontroller garbage-collection monotouch didreceivememorywarning<br \/>\nAs I understand it, we need to hold references to our Cocoa objects when dealing with them in MonoTouch. The reason for this is that the ObjC runtime might still hold references to the objects, and if we have no &#8220;MonoTouch references&#8221; on them, they could be garbage collected, which results in a EXC_BAD_ACCESS as soon as the ObjC runtime tries to access them.Say, we have two UIViewController subclasses, VC1 and VC2. If the user clicks on a button on VC1, the UI navigates to VC2, and the user can<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/361PK.jpg?s=32&amp;g=1\" \/><br \/>\nshaik riyaz<br \/>\nios objective-c ios7 uicollectionview didreceivememorywarning<br \/>\nI am using UICollectionView to show all the images available in my library using assets, its displaying all the images but when I scroll up and down many times , I receive a memory issue in the device and after some time it gets crashed saying CRASHED DUE TO MEMORY PRESSURE code used are as followscreates here the collectionview and settings its delegate UICollectionViewFlowLayout *layout=[[UICollectionViewFlowLayout alloc] init]; allPhotosCollectionView=[[UICollectionView alloc]initWithFrame:CG<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/da5a954590419be46936868a5c54f343?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nMax MacLeod<br \/>\nios uiviewcontroller didreceivememorywarning viewdidunload<br \/>\nWhen I&#8217;m debugging my iPad app, I found because of low memory, some view controllers&#8217; viewDidUnload got called. But seconds later, their viewDidLoad are called. And then again because of low memory, viewDidUnload, then viewDidLoad again. This is like file system keep swapping files due to low memory.Is it supposed to be like this, or I have done something wrong?Then I wanna release the view controller to get rid of this. But sometimes viewDidUnload is called before dealloc, and then crash due to<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b1300006caf8bdfa9317905f5eb5ec94?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\niCoder4777<br \/>\niphone ios-simulator didreceivememorywarning<br \/>\nI have a tab bar application. Each tab contains navigation controller allowing the user to transition from one view to the other. Each view is being handled by a view controller and each view controller class has -didReceiveMemoryWarning method. Problem: When I use &#8220;Hardware &gt; Simulate Memory Warning&#8221; option of iPhone Simulator in any model viewcontroller after after that if I want to dismiss that controller using &#8211; [self dismissModalViewControllerAnimated:YES]Then, viewDidLoad method is not cal<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/5b86bedcaa244cfeb499072ec278cd7a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNick Weaver<br \/>\niphone xcode ios memory-leaks didreceivememorywarning<br \/>\nI am using UIImage picker, Local notification, event calendar, Date Picker , Facebook Sharing, Sounds, Navigation controller , database . My application is crash after some time, the reason is not same, Some times memory is full and some times too manny other receive memory warning. Please guide me how can i generally remove the leaks?<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/2c8058b79526fbd623f216db5f35627e?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nmtb<br \/>\nios core-data persistence didreceivememorywarning<br \/>\nI added a managedObjectContext save to my applicationDidReceiveMemoryWarning method in the app delegate. The app seems to crash on some devices when I receive a memory warning now.It seems that the save pushes the app over the memory limit, as it is already low.The reason I have this save in that method is to catch anything that may not have been saved during normal app operation.Can someone tell me if this is bad practice?Thanks.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/i.stack.imgur.com\/cLBI9.png?s=32&amp;g=1\" \/><br \/>\nMcDJ<br \/>\niphone memory-management didreceivememorywarning<br \/>\nI&#8217;m developing an app which uses a UIScrollView to show a list of images based on search criteria. Using a button the user can load more images.When testing on an iPhone 4 the ViewController receives a memory-warning at ~750 images. When testing on an iPod 2nd generation a memory warning is received at ~150 images.My understanding is that when didReceiveMemoryWarning is called, one can free memory by releasing objects but recovery from low memory is not guaranteed.I&#8217;ve implemented didReceiveMemo<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/76f92c54145b18a9306072642ab93487?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nneha<br \/>\niphone uiwebview didreceivememorywarning<br \/>\nIn my application I have a tableview which a couple of cells on click of which I launch webview but my application crashes giving me memory warning level 2 even before the webview loads. I have cleared most of the memory leaks. How should I respond to this memory warning? They say that I have to unload the unwanted views. I&#8217;m confused here a bit. What should I be unloading here the webview, the tableview?Can anybody please help?Thanx in advance.<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/cb791c8f12e687d3538677321cdc8d2a?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nDaniel<br \/>\niphone background didreceivememorywarning<br \/>\nIs there a way to kill background apps?I have an app that I am working on that records a sound and then plots it out on a scroll view the problem I had with it is it crashes if the recording is too long because it runs out of memory trying to plot it. My fix to this is to monitor the amount of free memory and predict how much memory usage plotting will take and stop the recording just before there is not enough. The problem with that is the more apps I have running in the background the sooner i<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/42486fdf5fcdd7d4f390852bbe416985?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nNick H247<br \/>\nios uinavigationcontroller didreceivememorywarning<br \/>\nMy iPad application has a number of navigation controllers that are chosen dependant on selection of a list (a bit like how a tab bar controller works &#8211; or see the apple Remote application and choose Radio, and you should get the idea).I have limited the max depth of each of these navigation controllers to 50. I also clean up unnecessary RAM usage of non displayed view controllers periodically, or when i receive a didReceiveMemoryWarning.Using instruments the memory usage does not get above 3.5M<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/fb1b5f6466b194a2e66a8bc100d5b9cc?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\niSeeker<br \/>\nios cocos2d-iphone didreceivememorywarning cctexturecache<br \/>\nTo find a solution I have gone thru this similar link: TextureCache Error from Cocos2d when integrated into UIKit App but seems like it is dealing with this error in a different context..Question: I have a UIKit project integrated with Cocos2d. When build, succeeds and runs but, at times crashes after receiving a memory warning with this error:Assertion failure in -[CCTextureCache init], \/Users\/MyName\/Documents\/CSProject\/CSProject\/libs\/cocos2d\/CCTextureCache.m:90Terminating app due to uncaught<\/li>\n<li><img decoding=\"async\" src=\"http:\/\/www.gravatar.com\/avatar\/b3e4dd7c5432a1c61160d1b9b87399ff?s=32&amp;d=identicon&amp;r=PG\" \/><br \/>\nGuru<br \/>\nobjective-c cocos2d-iphone cocos2d cctexturecache<br \/>\nI want to change a sprite texture with another texture from a sprite sheet\/\/normal sprite character = [CCSprite spriteWithSpriteFrameName:@&#8221;char1.png&#8221;];\/\/change texture [character setTexture:[[CCTextureCache sharedTextureCache] addImage:[CCSprite spriteWithSpriteFrameName:@&#8221;char2.png&#8221;]]];but this gives me an error.I have tried without spriteWithSpriteFrameName and it gives me a blank texture.\/\/error Terminating app due to uncaught exception &#8216;NSInvalidArgumentException&#8217;, reason: &#8216;-[CCSprite last<\/li>\n<\/ul>\n<p>Web site is in building<\/p>\n<p>I discovery a place to host code\u3001demo\u3001 blog and websites.<br \/>\nSite access is fast but not money<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/www.m5zn.com\/newuploads\/2014\/01\/30\/jpg\/e7da807964b1fff.jpg\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Daniel ios memory-management xcode5 I am new to Objective C so this code is probably not written that well. When the app is launched, it calls the following code if it has not been saved into the phone yet. When it starts to loop through the while loop, the app crashes on any phone the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7147","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7147","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=7147"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7147\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7147"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7147"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7147"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}