exc-bad-access

Why is my cocoa program getting EXC_BAD_ACCESS during startup?

During the load of my cocoa application, my program crashes with the messsage EXC_BAD_ACCESS. The stack trace is not helpful. Any clues to how I can find the problem? ...

[iPhone] Objective-C array of objects misbehaving (EXC_BAD_ACCESS) in TableViewController

Hello stackoverflow. I'm new to Objective-C, and I can't figure out why the NSString objects in my array of Car objects seem to have been released. Here's my Car.m class: #import "Car.h" @implementation Car @synthesize categoryId; - (id)initWithPrimaryKey:(NSInteger)pk categoryId:(NSNumber *)catId carName:(NSString *)n { if (self...

Calling functions from within function(float *VeryBigArray,long SizeofArray) from within objC method fails with EXC_BAD_ACCESS

Ok I finally found the problem. It was inside the C function(CarbonTuner2) not the objC method. I was creating inside the function an array of the same size as the file size so if the filesize was big it created a really big array and my guess is that when I called another function from there, the local variables were put on the stack w...

UIAlertView fails to show and results in “EXC_BAD_ACCESS” error

A method is called when a return button on the keyboard is pressed. After calling another method which returns an integer a message is created based on that integer. The message is then passed into an UIAlterView and displayed to the user. The alert doesn't have any options (hence why I'm not calling a delegate), but simply notifies the ...

Iphone Core Data crashing on Save

Hi, I'm currently writing an Iphone application using Core Data and I get a EXC_BAD_ACCESS error during the [managedObjectContext save:&&error] code line. This crash only happens after I modify certain fields. More specifically my entity has two string fields (out of about 10 fields), that get their values from a the return of a modal vi...

Unexpected EXC_BAD_ACCESS in Objective-C

Hi, I have the following method: -(void)testAPIModule { self.requests = [NSMutableArray array]; NSLog(@"making arrays"); /*(A)*/ id array1 = [NSArray arrayWithObjects:[NSNumber numberWithInt:1], [NSNumber numberWithFloat:2], nil]; /*(B)*/ id array2 = [NSArray arrayWithObjects:[NSNumber numberWithInt:4], [NSNumber numberWithInt:5]];...

Can somebody give me a hand about this stacktrace in iPhone app?

Program received signal: “EXC_BAD_ACCESS”. (gdb) bt #0 0x30011940 in objc_msgSend () #1 0x30235f24 in CFRelease () #2 0x308f497c in -[UIImage dealloc] () #3 0x30236b78 in -[NSObject release] () #4 0x30a002a0 in FlushNamedImage () #5 0x30250a26 in CFDictionaryApplyFunction () #6 0x30a001a4 in _UISharedImageFlushAll () #7 0x30a007...

iphone debugging help- see when objects are released?

I'm a little ways into developing my first iphone app, and I've been running into exc_bad_access a lot. (I'm sure it's because I'm not designing stuff in a very MVC-proper way yet.) It's extremely frustrating trying to hunt down why I'm running into these errors all the time... is there a way in the xcode debugger to keep a watch list ...

UIWebView EXC_BAD_ACCESS crash

I'm experiencing crashes of an app that uses UIWebView. Usually it's when page is not fully loaded and UIWebView is sent stopLoading selector. Or when UIWebView fully loaded page. I've got EXC_BAD_ACCESS. Stack looks like this: #0 0x95bb7688 in objc_msgSend #1 0x30a671db in -[UIWebView webView:decidePolicyForNavigationAction:request:f...

iPod Touch on device debugging crashes (EXC_BAD_INSTRUCTION, EXC_BAD_ACCESS)

I'm using iPod Touch 2G as a developement device with Xcode 3.1.3. When I try to trace the execution on the device from a breakpoint in the debugger I get EXC_BAD_INSTRUCTION, EXC_BAD_ACCESS or some error with debugger not being able do disassemble something. The same thing will work properly on iPhone Simulator. Previously I've been abl...

clever ways of tracking down bugs in Obj-C

I'm having a bug in my Objective C program which causes the machine to crash hip deep in some library methods, and it's all library methods down the stack to main (Which I haven't touched from the one XCode gave me). So, I have a bit of a mystery. The error I'm getting is: Program received signal: “EXC_BAD_ACCESS”. Now, I'm sure tha...

EXC_BAD_ACCESS on iPhone when using "obj != nil

I've got a very simple line of code in Objective-C: if ((selectedEntity != nil) && [selectedEntity isKindOfClass:[MobileEntity class]]) Occasionally and for no reason I can tell, the game crashes on this line of code with an EXC-BAD-ACCESS. It usually seems to be about the time when something gets removed from the playing field, so I'...

Breakpoints get deactivated in Xcode: EXC_BAD_ACCESS when NSZombieEnabled == YES

My app crashes at (seemingly) random events. So, I wanted to add NSZombieEnabled to debug my iPhone application. I cloned my target and set its Info.plist to the same as the original target and set NSZombieEnabled to YES. Once i run the app, it crashes with a stack trace of... #0 0x3025db0c in ___forwarding___ () #1 0x30239db2 in __f...

Getting “EXC_BAD_ACCESS” when accessing instance variable from within UITableView delegate method

My iPhone application blows up when it accesses an instance variable from within one of the UITableView delegate methods. I think I'm retaining it so I do not understand why I can't access it without a problem. Here's my .h file #import <Foundation/Foundation.h> #import "AlertSummaryCell.h" #import "AlertDetailViewController.h" @inte...

EXC_BAD_ACCESS when using NSOutlineView

Hi, i'm trying to get a Outline view to display a directory, now I've edited the example from Apple to make it work from any directory I set, except when expanding any node I get "EXEC_BAD_ACCESS" from the NSOutlineView class. Here is the header file: #import <Cocoa/Cocoa.h> @interface SMLDirectoryDataSource : NSObject { NSString ...

CGContextSetFillColorWithColor error (EXC_BAD_ACCESS).

I am confused why my app is crashing with this error. I have implemented the displayLayer method (for rendering CALayer). The first time this method runs things work fine. But subsequent calls to this is when the error occurs. The error seems to occur when the self.bgColor is being set to the context fill color. INTERESTINGLY... if I c...

Break on EXC_BAD_ACCESS in XCode?

I'm new to iPhone development and XCode in general and have no idea how to begin troubleshooting an EXC_BAD_ACCESS signal. How can I get XCode to break at the exact line that is causing the error? I can't seem to get XCode to stop on the line causing the problem, but I do see the following lines in my debug console: Sun Oct 25 15:...

Waiting for iPhone Memory Management

Hi - I am receiving a EXC_BAD_ACCESS when I am presenting another controller in Modal view. Apparently, when I get to that controller's viewDidLoad, some variables are "invalid". However, if I wait like 20 seconds, then the controller will load fine. I am new to iPhone. Sorry for a newbie question. ...

OpenCV matrix access produces EXC_BAD_ACCESS

When I run the following program with scalefactory higher than 1.5, the program throws an EXC_BAD_ACCESS. The program scales an image. #include <iostream> #include <OpenCV/cv.h> #include <OpenCV/highgui.h> #include <cmath> using namespace std; using namespace cv; int scale (int xyvalue, float scalefactor) { return ceil(xyvalue/sca...

NSImage leaking?

So I'm trying to duplicate the SourceView example in my app. I can generate the source list perfectly, fine. I can also expand the containers, and everything is displayed fine. However, when I select an item in the list, the app crashes with an EXC_BAD_ACCESS. Backtrace #0 0x7fff86532340 in objc_msgSend_vtable14 #1 0x7fff8508f622 in ...