exc-bad-access

My App calls scrollViewDidScroll 19 times

I have an app based on Apple's PageControl sample. The first time the view loads, the scroll view is loaded with page 0 and page 1. Whenever a scroll is initiated, the scrollViewDidScroll method should get called by UIKit correct? When initiating a scroll from page 0 to page 1, the app should load page-1, page and page+1, (to prevent fl...

EXC_BAD_ACCESS after UIViewController is popped from UINavigationController

I am really not sure why this is happening because I have similar logic all over my program but for some reason the following code seems to be where my app is crashing -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSInteger row = [indexPath row]; LessonRunViewController *lessonRunView = ...

SBJsonParser: App crashes if I do not retain the return value

I create/push my ViewController, display some informations and navigate back to my RootViewController. While I navigate back the app crashes (EXC_BAD_ACCESS). With Instruments I found out that the dealloc of my ViewController is called, which releases my wrapper class. In my wrapper class also the dealloc method is called. This dealloc ...

Need Help Tracking Down EXC_BAD_ACCESS on Function Entry on MacOS

I have a program that gets a KERN_PROTECTION_FAILURE with EXC_BAD_ACCESS in a very strange place when running multithreaded and I haven't the faintest idea how to troubleshoot it further. This is on MacOS 10.6 using GCC. The very strange place that it gets this is when entering a function. Not on the first line of the function, but th...

NSMutableArray causing EXC_BAD_ACCESS crash after viewcontroller did disappear and re appears

Still "somewhat" of a newbie... I have an NSMutableArray that stores filenames - when a user clicks a UITableView the corresponding selected cell will pass the certain filename in the array to MPMoviePlayerController to play. It works, however if I exit out of the viewcontroller and come back, only the last video that I played will work,...

Objective-C handling integer values

I am getting confused with how to handle Integers in Objective C. If I define the following: NSInteger i = 6; NSLog(@"%d", i); I expect it to print 6 to the console. however I have an NSInteger within an object which is obviously reference by a pointer so I get very difference results. For example: @interface Section : NSObject { ...

UIPickerView problems

Hi all, I have a very simple application that use a 2 component UIPickerView that causes me a crash every time I click over it. I dragged it into my view by IB, then hooked up dataSource and delegate to File's Owner. In the .h file: @interface SettingsViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate> { W...

Objective-C array of floats misbehaving (EXC_BAD_ACCESS)

I'm declaring an array of primitives on one of my objects, and cannot seem to access it from the outside. I'm fairly new at ObjectiveC, is there some obvious mistake I'm making? header file: @interface MyObject : NSObject { //@public <-- this shouldn't be necessary, right? I have accessors! float *d; } @property float *d; ...

EXC_BAD_ACCESS Crash when displaying AdWhirl ad on iPhone

Hi, I am using AdWhirl in my app and got a suspicious crash mid-game. It appears to crash in the animationDidStop:finished: function which I didn't create. Could this be a bug in AdWhirl? I can't find this file referenced in the log: (MMHTMLAdView.m:123) This is the log: Date/Time: 2010-10-21 09:54:14.861 +0200 OS Version: ...

objective c losing NSDecimalNumber value when accessed from another method

I am parsing Json Data into an NSDecimalNumber as follows product.Price = [NSDecimalNumber decimalNumberWithDecimal:[[jProduct objectForKey:@"Price"] decimalValue]]; This is in a loop with each product being added to an array. At the end I release the json object. If I Log the value of product.Price during the loop the value is corre...

Why does my iPhone application crash when it receives a memory warning?

This is sort of a mystery to me. My application does not use very much memory but if I put it in the background and run as many memory-intensive applications as I can, occasionally my application will crash when I try to wake it up. I've looked at the crash log and this is what I see: 0 libobjc.A.dylib 0x000027da ...

exc_bad_access from object returned from NSKeyedUnarchiver

I am having trouble loading from saved data an instance of a custom class that conforms to the NSCoding protocol. My class has a UIImage property and when I assign a new UIImage to it the program crashes with an exc_bad_access. In the view controller I declare my object like so: @interface SomeViewController : UIViewController { ...

Assigning a selector crashes on iPod touch 2nd generation

Update: problem magically disappeared, see comment I have a function which works fine on an iPhone 3G, iPhone 3Gs and simulator but crashes on an iPod touch 2nd generation. - (id) initWithDelegate:(id) delegate data:(NSData *) data finishSelector:(SEL)finishSelector{ if(self = [super init]){ _delegate = dele...

EXC_BAD_ACCESS - iPhone

Hi My iPhone app is crashing and getting EXC_BAD_ACCESS error when using this code: NSError *error; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); //1 NSString *documentsDirectory = [paths objectAtIndex:0]; //2 NSString *path = [documentsDirectory stringByAppend...

UIAlertView is causing a EXC_BAD_ACCESS

I get an error with the following code. Essentially the app confirms calling the number when it is selected from the table view. The EXC_BAD_ACCESS is coming in when the ViewContoller with this alert is dismissed. It only happens if the alert is triggered. It does not if the table is only viewed with no selection. That tells me I am doi...

Problem with NSStrings and UIAlertView

I have having a very odd issue when utilizing this UIAlertView. When viewing a Physician they have several offices. Upon selecting one you get an alert that offers to call this location or display it on a map. To create the alert and to have data at the ready when the alert is dismissed, I declared 4 NSStrings (although I probably only n...