ios,cocos2d-iphone,didreceivememorywarning,cctexturecacheRelated issues-Collection of common programming errors
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 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
user2541100
ios audiounit
I 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
Kara
ios xcode core-data memory
With 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
Ricardo Cerqueira
ios xcode crash cocos2d adhoc
my app runs fine on development mode, but for some reason on ad hoc i get a crash right after loading screen.I really can’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 – the app displayed a launch image then quit unexpectedly. This may be b
Davoda
ios objective-c facebook-graph-api facebook-ios-sdk
I have a token but keep getting this error: “An active access token must be used to query information about the current user.” Any help is appreciated 🙂 NSLog(@”TOKEN : %@”,[[FBSession activeSession] accessToken]);NSString *picture = [NSString stringWithFormat:@”http://www.prowebdev.org/WooF/API/OpenGraph.php”];NSString *image = [NSString stringWithFormat:@”http://www.prowebdev.org/WooF/API/upload/356.jpg”];NSString *imageBool = [NSString stringWithFormat:@”true”];NSMutableDictionary *myDiction
zakishaheen
ios crash google-analytics crash-reports
I get the following crash (0x8badf00d) because of something to do with Google Analytics SDK 1.1. What’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:
raulCab
ios
I 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
Ben L.
ios core-data crash game-center gamekit
I 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
Rakhe Kara
ios iphone objective-c cocoa-touch
Actually 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:@”Environment” ofType:@”plist”];Line 38: NSDictionary *environments = [[NSDictionary alloc] initWithContentsOfFile:envsPListPath];But according to exception type:00000020
Sean Freitag
ios xcode xctest
When running integration tests w/ live requests against a server, sometimes I get the following crash. Does anyone have an idea why?I’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 <- https://site/30012.zipjson?deltadate=2014-02-22T16%3A31%3A56.000Z&encrypt=N 2014-01-23 14:55:47.186 xctest[74229:303] GET -> https://site/30012.zipjson?deltadate=2014-02-22T16%3A31%3A56.000Z&encrypt=N 2014-01-23 14:5
Waneck
iphone ios opengl-es cocos2d-iphone antialiasing
I 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’ve set up 4x Multi-Sampling Anti-Aliasing using apple’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
rmaddy
xcode opengl-es cocos2d-iphone
I’ve created an iPhone game which utilizes some code from an old version of the Cocos2D iPhone game development framework and I’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’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
Stephane Delcroix
cocos2d-iphone monotouch xamarin.ios
I 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’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) <IL 0x00025, 0xffffffff>at MonoTouch.Cocos2D.CC
dropcode
c++ cocos2d-iphone box2d box2d-iphone
I don’t know much C++ and I am trying to implement a solution I found – (Getting the world’s contactListener in Box2D) using Cocos2d-box2d. Here is the Contact Listener.SubcContactListener.h:#import <Foundation/Foundation.h> #import “cocos2d.h” #import “Box2D.h” #import <vector> typedef std::pair<b2Fixture*, b2Fixture*> fixturePair; typedef std::vector<fixturePair> thingsThatTouched;extern thingsThatTouched g_touchingFixtures;class SubcContactListener : public b2ContactLi
James Webster
cocos2d-iphone callback game-physics chipmunk
I’m using Cocos2d v3 and want to change a body from dynamic to static after colliding with another body. At the moment I’ve 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
Guru
objective-c cocos2d-iphone core-audio simpleaudioengine
I read about preloading sounds in SimpleAudioEngine through [[SimpleAudioEngine sharedEngine] preloadEffect:@”bell.wav”];But, with this there are memory leaks which I read on couple of sites. On some websites it was used like this: –(void)loadSoundFilesInBackground {NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];[[SimpleAudioEngine sharedEngine] preloadEffect:@”bell.wav”];[pool release]; }What is the best way to load sound files in background through SimpleAudioEngine ? What is the
Just Kidding
cocos2d-iphone
cocos2d-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
Tiddly
iphone ios cocos2d-iphone cocos2d
I’m using cocos2d for iOS. Not sure if I’m doing something wrong here or if CCParallaxNode does something strange that I just don’t understand.I’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’s going wrong. When the game loads the layer it’s always offset down and left by about 30% of the image size. I’ve uploaded an image demonstrating the difference in position here ht
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
cheeesus
objective-c uiviewcontroller garbage-collection monotouch didreceivememorywarning
As 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 “MonoTouch references” 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
shaik riyaz
ios objective-c ios7 uicollectionview didreceivememorywarning
I 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
Max MacLeod
ios uiviewcontroller didreceivememorywarning viewdidunload
When I’m debugging my iPad app, I found because of low memory, some view controllers’ 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
iCoder4777
iphone ios-simulator didreceivememorywarning
I 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 “Hardware > Simulate Memory Warning” option of iPhone Simulator in any model viewcontroller after after that if I want to dismiss that controller using – [self dismissModalViewControllerAnimated:YES]Then, viewDidLoad method is not cal
Nick Weaver
iphone xcode ios memory-leaks didreceivememorywarning
I 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?
mtb
ios core-data persistence didreceivememorywarning
I 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.
McDJ
iphone memory-management didreceivememorywarning
I’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’ve implemented didReceiveMemo
neha
iphone uiwebview didreceivememorywarning
In 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’m confused here a bit. What should I be unloading here the webview, the tableview?Can anybody please help?Thanx in advance.
Daniel
iphone background didreceivememorywarning
Is 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
Nick H247
ios uinavigationcontroller didreceivememorywarning
My 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 – 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
iSeeker
ios cocos2d-iphone didreceivememorywarning cctexturecache
To 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
Guru
objective-c cocos2d-iphone cocos2d cctexturecache
I want to change a sprite texture with another texture from a sprite sheet//normal sprite character = [CCSprite spriteWithSpriteFrameName:@”char1.png”];//change texture [character setTexture:[[CCTextureCache sharedTextureCache] addImage:[CCSprite spriteWithSpriteFrameName:@”char2.png”]]];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 ‘NSInvalidArgumentException’, reason: ‘-[CCSprite last
Web site is in building
I discovery a place to host code、demo、 blog and websites.
Site access is fast but not money