exc-bad-access

How to diagnose a KERN_PROTECTION_FAILURE

I am getting an interesting crash that I can never seem to replicate on the simulator: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Codes: KERN_PROTECTION_FAILURE at 0x00000008 Crashed Thread: 0 Thread 0 Crashed: 0 libobjc.A.dylib 0x3212e86c 0x3212c000 + 10348 1 StockTwits 0x00016b06 0x10...

EXC_BAD_ACCESS with iPhone SDK UINavigationController

Okay so I am trying to use a simple UINavigationController with iPhone SDK in Xcode and it works all well when pushing but if go past 2 pushes and try to pop the view controllers I keep getting the error: EXC_BAD_ACCESS I know what it means but how the heck do I fix it? Here is my code... (Assume the MainViewController has a button tha...

Strange output when trying to access data

I have a data structure object which is loaded from an XML file inside the "did finish loading" method of the delegate. If I use the data objects "printData" method from inside the load method of the delegate it shows all the info. I can do this multiple times. However, I have a button which runs a second method in the delegate and al...

Releasing reference to UIApplication's delegate results in EXC BAD ACCESS, why?

Hello I am running my application through xcode's static analyzer and it pointed out that I had a potential leak in a file: MyAppDelegate *delegate = (MyAppDelegate *)[[UIApplication sharedApplication] delegate]; So after the code I do [delegate release]. This results in an EXC BAD ACCESS when the view controller I am doing this in ...

iphone using cocos2d get EXC_BAD_ACCESS

I am making a simple game project involving the use of Cocos2d. Now as defined by Ray Wenderlich's example, i have completed the whole tutorial but added an extra bit of code myself to check total number of melons, when they reach 3, i replace screen with "You Win" screen to notify the user that he has won using [[CCDirector sharedDirect...

iphone cocos2d CCSprite EXC_BAD_ACCESS

Friends i am new to cocos2d programming and Mac in general! I have noticed this EXC_BAD_ACCESS errors ruining most of my time... Take the following snippet of code from the Geek & Dad's tutorial... -(void) AddEnemyAtX:(int)x Y:(int)y { CCSprite *enemy1 = [CCSprite spriteWithFile:@"enemy1.png"]; enemy1.position = ccp(x,y); ...

EXC_BAD_ACCESS after calling popViewControllerAnimated

I'm getting an EXC_BAD_ACCESS after calling dismissModalViewControllerAnimated on my view controller. My project is based on the table view starter project, and RootViewController creates a view like this: GobanVC *vc = [[GobanVC alloc] initWithNibName:@"GobanVC" bundle:[NSBundle mainBundle] coll:c]; [self.navigationController pushView...

Objective-C error EXC_BAD_ACCESS help please

Hello, I am currently using the pragmatic screencast on Objective-C to help me program in objective-c. I have a background in Java and C++, but I am having a very difficult time getting used to everything in Objective(Mostly because I am not comfortable with the syntax). Below is the error I am receiving with all the code. I am also get...

EXC_BAD_ACCESS Exception in iPhone

Hi there, i got this piece of code: - (void)postToWall { FBStreamDialog *dialog = [[FBStreamDialog alloc] init]; dialog.userMessagePrompt = @"Un tuo commento:"; dialog.attachment = [NSString stringWithFormat:@"{\"name\":\"Bla: %@\"", facebookName]; [dialog show]; [dialog release]; } the first time it get executed it works fine, no p...

EXC_BAD_ACCESS on device, but fine on Simulator

I have a scroll view app which runs fine on the simulator, however, when installed on the device, it gives me an EXC_BAD_ACCESS, when i attempt to scroll one page. I have ran it through Instruments with Allocations and Leaks, but nothing is leaked and no zombies are messaged... i'm just curious what could cause such a difference in simul...

EXC_BAD_ACCESS in for loop

In this code, in the second for loop, i get an EXC_BAD_ACCESS if I use an identifier other than i and j. if (UIDeviceOrientationIsPortrait(deviceOrientation)){ numRows = 4; numCols = 3; }else { numRows = 6; numCols = 1; } for (int row = 0; row < numRows; row++){ for (int col = 0; col < numCols; col++) { ...

Release of NSString Causing EXC_BAD_ACCESS

Thanks for your help on this one. I am pulling a NSDictionary from a plist in my main bundle and am having troubles. Here is the code: - (void)viewDidLoad { // Pull in FAQ from Plist NSString *strFAQPlist = [[NSBundle mainBundle] pathForResource:@"FAQs" ofType:@"plist"]; dictFAQList = [[NSDictionary alloc] initWithContents...

NSString EXC_BAD_ACCESS

I'm stuck with the following bit of code. NSString *gridRef = [[NSString alloc] initWithFormat: @"%@", [converter LatLongToOSGrid: latLong]]; NSLog(@"Grid Ref: %@", gridRef); self.answerLabel.text = [[NSString alloc] initWithFormat: @"%@", gridRef]; When I log gridRef, it displays the correct result. However, the line setting answerLa...

-[UIViewAnimationState sendDelegateAnimationDidStop:finished:]: message sent to deallocated instance 0x5677780

Hi there, I have a TabBarController, which contains 4 tabs with a UITableView init. The content of each table view is downloaded from server. There is no problem, if I switch tabs slowly. But if I switch tab a bit faster, I always get the "message sent do deallocated instance" when I insert rows into table, following is the insert code:...

Splash Screen: EXC_BAD_ACCESS after calling dismissModalViewControllerAnimated delayed.

Hi, I am trying to create a 1-2 second splashcreen for my application using a modal view controller however when i try to dismiss the view my application crashes with a bad access error. So in my application delegate i have: - (BOOL) application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { ...

Issues with NSOperationQueue and dealloc being called and crashing App

I've created an NSOperation in the queue like so: ImageLoadingOperation *operation = [[ImageLoadingOperation alloc] initWithImageURL:url target:self action:@selector(didFinishLoadingImageWithResult:)]; [operationQueue addOperation:operation]; [operation release]; And this works fine but if the view gets popped before the operation fin...

iPad Dev: Getting an EXC_BAD_ACCESS when trying to access shared instance object

I've got code that uses a shared instance object (Database) as a placeholder for a few application variables that need to be checked at different parts of the app. Inside of that shared instance, I have an object called Session that has 4 variables in it (ID, Name, StartTime, EndTime). I init the session and pass it into the shared ins...

removeFromSuperview crashes when called on UIScrollView and UIScrollView crashes when scrolling past the right end.

Hello. In my program I have this code: @try{ if (online_scores_pages != nil){ NSLog(@"Here - %@",online_scores_pages); }else{ NSLog(@"NIL"); } [online_scores_pages removeFromSuperview]; NSLog(@"Here 2"); [self becomeFirstResponder]; NSLog(@"Here 3"); section = CURLING_MENU; }@catch (NS...

Core Data database doesn't save

I'm trying to implement the Paparazzi 2 assignment from the Stanford CS193 course and I'm running into a problem. My one call to save the database is when the app exits (I'm borrowing heavily from Mike Postel's version to check my code): - (void)applicationWillTerminate:(UIApplication *)application { if (flickrContext != nil) { ...

Simple UITextView crashing

I'm trying to use a simple UITextView in a basic view, but it causes the app to crash sporadically. Sometimes it crashes while I'm typing something in it, sometimes when I'm scrolling, sometimes after I hit the return key. From the stack trace, it looks like it's being caused by graphics or animation related code for rendering UI element...