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 anything on the Instruments panel.
What should be the next step? I mean how can I get the lines which are causing the bad access? I am stuck on this for hours but still couldn't find the procedure.
Any help is appreciated.
Accessing a deallocated object is not the only reason you would get EXC_BAD_ACCESS. Other causes of bad access errors include accessing nil pointers and going past the bounds of an array.
Looking at your screenshots, you are not using a deallocated object. If you were using a deallocated object, the Zombies template in Instruments would let you know. Instruments would show a message similar to the following:
Your next step should be to set an exception breakpoint in Xcode. When your app crashes, Xcode will pause your app at the point where the crash occurs. To set an exception breakpoint, open the breakpoint navigator by choosing View > Navigators > Show Breakpoint Navigator. Click the + button at the bottom of the navigator and choose Add Exception Breakpoint.
Related
Hi I am working on an app witch worked great yesterday and when I re opened the project today and launched it on the simulator, my app crashed with no error message, how could I find out where the problem comes from? I added a screenshot of when my app craches. Please note that I have seen some similar questions on here that did not solve my problem
Two suggestions to try and track down the source of the crash:
Add an Exception Breakpoint on "All Exceptions"
Enable Zombie Objects in your project's Debug Scheme to see if you're sending a message to a de-allocated object
Try the two debugging steps separately (first enable Exception Breakpoint then enable Zombie Objects.)
Have you also tried cleaning the project and deleting/re-installing app from Simulator?
Make sure that the action handlers are properly linked up to your objects in MainStoryboard. e.i. if you look at your ViewController and find your object definition
#IBOutlet weak var sampleTextBox: UILabel!
It should have a circle to the left of this line of code. These circles should be filled in if everything is properly connected. If you see empty circles then these lines are not connected to objects properly. You will need to reconnect these lines to the Objects in the Storyboard by right clicking on the circle and dragging to the object in question.
Ok so after doing some research I realized that the "signal SIGABRT" was a connection problem so I went to the main storyboard, and to the connections inspector and I had some connections with a "!" so I deleted them and the app works great again ! I suspect it was because of some connections I deleted by error and reconnected either way if your having this issue be sure to check the connections inspector and delete all connections with a "!"
I am getting the following error on my app when it randomly crashes during testing.
The logs show the following:
Is there any way possible I can track why this error is apprearing? I'll be super grateful.
Best.
Go to the Breakpoint Navigator. Click the plus sign on the bottom left. Add exception breakpoint. It will break right before the weird error you are seeing :)
You know the pane on the left that shows your files? At the top of it there are 7 buttons or so, and one is shaped like a breakpoint. That's the navigator.
This EXC_BAD_ACCESS error pops up once every 5~8 runs.
I am aware that it's caused by duplicate or bad variable usages, etc.
But I can't find exactly WHERE it is causing this error from my codes.
Is there a way to find out which variable is causing such problem?
You can use Zombie to get symbolicated info related to crash
Enable Zombie Objects by-
And then, checking the Enable Zombie Objects checkbox,
Run(profile) your project in simulator -
The instruments will be launched as-
Instruments would show a message similar to the following:
Your next step should be to set an exception breakpoint in Xcode. When your app crashes, Xcode will pause your app at the point where the crash occurs. To set an exception breakpoint, open the breakpoint navigator by choosing View > Navigators > Show Breakpoint Navigator. Click the + button at the bottom of the navigator and choose Add Exception Breakpoint.
Happy iPhone Day everyone! I hope everyone managed to get their hands on one.
I have a strange issue. In my code, I have a UITableView and if the user selects the Email icon in the UINavigationBar, it does two things:
1) Opens up the MFMailComposer
2) Creates a PDF in the background of the contents of the UITableView and attaches it to the email
This has so far been working very well in iOS 7. With iOS 8, if I set an exception breakpoint in my code and run it on an iOS 8 device, it will crash when I click the email icon (iPhone 5s), pointing to the code below:
[strheader drawWithRect:CGRectMake(65, -670, 1024, 100) options:NSStringDrawingUsesLineFragmentOrigin attributes:#{NSFontAttributeName:headerFont} context:nil];
It doesn't let me jump in or out of this breakpoint or do anything to find out what's going on. If I remove the Exception breakpoint, there's no crash. If I run the app on my device and disconnect the device from Xcode, run it again, there's no crash.
So ultimately, there's no crash when running my app, but it makes me extremely nervous that with an exception breakpoint, it crashes at that code above which means something isn't right somewhere.
There are no warnings in my code. The method that does the saving of the PDF to the email (which contains that code) is extremely long; if it's required, I'll paste it here but I don't want to make this question longer than it needs to be.
If I remove the exception breakpoint from that line and just set a regular breakpoint, as expected, it stops at that point. I run through and there are no errors at all. If I run through the whole breakpoint, it does what it needs to and then shows the MFMailComposer in the App. So it's not actually "crashing", but the exception breakpoint clearly has a problem with it.
How can I find out WHY it's crashing? More importantly, how can I fix it? (which will probably only be answerable after the first question gets answered).
I have no idea what is after going wrong but I'll state the events that happened before the error occurred
1: App was running fine as I was adding functionality.
2: I noticed that one of the view controllers was not showing the correct version but an older one. (I had added in a segmented control and it wasn't showing up)
3: I tried to uninstall the from my phone and build it again but it was still showing the old controller
4: I tried cleaning the project to recompile everything, after this step the application started to give me this problem
http://i.imgur.com/105yDr8.png
Some extra information:
1: This error occurs on the black screen before any view controllers load
2: The view controller I was working on was not the first view controller (so I do not think that it is the problem)
3: The main view controller has not been changed in days and was working perfectly since it was finished
I have absolutely no idea what is going wrong, and help would be greatly appreciated
UPDATE 1
New error message
http://i.imgur.com/5XVJWHT.png
UPDATE 2
Screenshot of storyboard and a finder window that opened when I clicked "show in finder on the storyboard". This would lead me to believe that it does know where the file is
http://i.imgur.com/Ybas1Yx.png
You've (probably accidentally) set a breakpoint at the return UIApp...-line.
You can identify a breakpoint by it's blue color at the left of a line. If it's activated, it's dark blue, else it's light blue. You can just drag it either to the trash can or somewhere else in your window to completely delete the breakpoint.
your app is getting crashed due to exception check the pannel objc_exception_throw
add exception breakpoint and you'll get the line of code where your app is crashing
It sounds like something is broken, and throws an exception. You're just seeing the exception being caught.
The way to investigate what is throwing is to add an exception breakpoint. Go to the breakpoints list and hit +, choose exception breakpoint and leave it at all. This should give you a breakpoing at the point where the except is being thrown.
As to what is happening. You had an app that ran with an old VC, you deleted the app and re-installed and now it crashes, so best guess is that your old version had the VC, but new one doesn't. Sounds like a missing xib or storyboard. It clearly isn't missing from the project, as you'd see that immediately, but check for target membership, changed name or localization problems.
I fixed the problem by renaming the storyboard to MainStoryboard1 and changing the target in
project > target > summary > iphone/ipod deployment