exc-bad-access

Enable and Debug Zombie objects in iOS using Xcode 5.1.1

穿精又带淫゛_ 提交于 2019-11-27 15:34:18
I have an iOS(7.1) app which crashes due to EXC_BAD_ACCESS . If I am not wrong, this happens due to the use of an object which is already de-allocated. After a bit of searching, I found out that enabling Zombie objects help to pin point the line of error. As I am using xcode 5.1.1, I have done the following to Enable Zombie Objects . And then, checking the Enable Zombie Objects checkbox, Then I went to Instruments panel, selected Zombies ,clicked Profile and got this, Now the simulator (in the left background), which had a button and a textfield is running blank and also I can't understand

NSDateFormatter crashes when used from different threads

可紊 提交于 2019-11-27 14:40:00
问题 We keep getting a random, weird crash with NSDateFormatter . The relevant stack trace is: Program received signal: “EXC_BAD_ACCESS”. #0 0x00000005 in ?? () #1 0x0213e3c3 in udat_parse () #2 0x01d4e1ca in CFDateFormatterGetAbsoluteTimeFromString () #3 0x01d4e225 in CFDateFormatterCreateDateFromString () #4 0x003e2608 in getObjectValue () #5 0x003e2921 in -[NSDateFormatter getObjectValue:forString:errorDescription:] () #6 0x003e21cd in -[NSDateFormatter dateFromString:] () The date formatter is

“Thread 6 com.apple.NSURLConnectionLoader: Program received signal: EXC_BAD_ACCESS”

狂风中的少年 提交于 2019-11-27 11:43:35
问题 The app crashes about 15 seconds after launching and XCode just breaks at an address and gives me a pop up that says "Thread 6 com.apple.NSURLConnectionLoader: Program received signal: EXC_BAD_ACCESS" I've been totally unable to track the problem down. It works fine running on iOS 4, but I'm guessing that's just because it is more tolerant of the bug or something. I've tried setting breakpoints everywhere and stepping through, running it in Instruments under the Zombies profile, but it just

EXC_BAD_ACCESS code 2 on UIAlertView in iOS6

戏子无情 提交于 2019-11-27 11:05:08
问题 I'm trying to figure out why im getting this crash in my app. It works perfectly fine in Xcode 4.4 running in the simulator with ios5.1, but when i switch into xcode 4.5 and ios6 I'm getting an EXC_BAD_ACCESS code 2. Here is my code: - (void) myMethod { UIAlertView *alertview = [[[UIAlertView alloc]initWithTitle:@"Title" message:@"message" delegate:self cancelButtonTitle:@"OK" otherButtonTitles: nil] autorelease]; alertview.tag = 1 [alertview show]; } this is giving me an EXC_BAD_ACCESS code

UIWebView EXC_BAD_ACCESS crash

萝らか妹 提交于 2019-11-27 10:00:31
问题 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:frame:decisionListener:] #2 0x3024a10d in __invoking___ #3 0x30249ff8 in -[NSInvocation invoke] #4 0x358ab160 in HandleDelegateSource #5 0x302452c1 in

Assigning an existing CGColor to a CGColor property works in iOS Simulator, not iOS device. Why?

给你一囗甜甜゛ 提交于 2019-11-27 09:17:08
I know how to fix the problem that I am about to outline, however, I am a bit baffled as to why the code scenario works in the iOS simulator but not on my iPad. I have a method that checks various properties, and then sets the background color of a CALayer depending on the state of a property. The following code is similar to my method of color assignment: //This will be the CALayer BGColor... CGColor c = UIColor.blueColor.CGColor; //Blue is the default switch (myState) { case state_one: c = UIColor.greenColor.CGColor; //... more code ... break; case state_two: c = UIColor.redColor.CGColor; //

Random EXC_BAD_ACCESS in a place that it cannot happen

吃可爱长大的小学妹 提交于 2019-11-27 08:25:31
问题 I'm receiving EXC_BAD_ACCESS at random times in a place that I confirmed the exception should not happen. The line its happening on is `[[LevelEditorScene sharedLevelEditor] setObject:object forKey:key]` LevelEditorScene is a class, setObject:forKey: is a method I implemented (not the one from NSObject ) In GDB: (gdb) print-object [LevelEditorScene sharedLevelEditor] <LevelEditorScene = 06C3FF40 | Tag = -1> Means LevelEditorScene sharedLevelEditor is ok. (gdb) print (bool)[[LevelEditorScene

finding reason for EXC_BAD_ACCESS - in Xcode4

时光总嘲笑我的痴心妄想 提交于 2019-11-27 07:28:26
问题 I get an EXC_BAD_ACCESS error at a place that doesn't have anything to do with the root cause. I fortunately found the reason to be an array that was too small for the following statement [data getBytes:&tcpBuffer length:i]; . Now my question: I tried all these theree methods - but without success: Using NSZombiesEnabled did not change anything in the debug window printout When I set the scheme to debug and to use Leaks instrument it starts the leaks instruments but I don't see the debugger.

Is there a way to catch or handle EXC_BAD_ACCESS?

风流意气都作罢 提交于 2019-11-27 03:47:58
问题 As far as I understand, EXC_BAD_ACCESS happens when you try to access bad memory (feel free to correct me if I'm wrong)? Is there a way to kind of catch it like in a try-catch in Java to prevent total app failure? 回答1: Nope; EXC_BAD_ACCESS means things have gone wildly off the rails. Your program is trying to access a memory address that is invalid. I.e. memory has been corrupted and there is no predictable recovery. It may be a memory management issue. If you can reproduce the issue, turn on

NSJSONSerialization results in EXC_BAD_ACCESS

醉酒当歌 提交于 2019-11-27 02:57:42
问题 Currently I am writing an app (Target iOS 6, ARC enabled) that uses JSON for data transmission and Core Data for persistent storage. The JSON data is generated out of a MySQL database by a PHP script via json_encode. My Problem is that with data from certain tables the following code fails: - (NSDictionary *)executeFetch:(NSString *)query { NSURL *requesturl = [NSURL URLWithString:[query stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]]; NSError *dataError = nil; self.jsonData