exc-bad-access

CGImage/UIImage lazily loading on UI thread causes stutter

风格不统一 提交于 2019-11-27 00:06:54
My program displays a horizontal scrolling surface tiled with UIImageViews from left to right. Code runs on the UI thread to ensure that newly-visible UIImageViews have a freshly loaded UIImage assigned to them. The loading happens on a background thread. Everything works almost fine, except there is a stutter as each image becomes visible. At first I thought my background worker was locking something in the UI thread. I spent a lot of time looking at it and eventually realized that the UIImage is doing some extra lazy processing on the UI thread when it first becomes visible. This puzzles me,

Iphone Core Data crashing on Save

为君一笑 提交于 2019-11-26 23:02:51
问题 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 view controller (like a text editor). The crash also only happens after these fields are edited, the first time I put a value in it works fine. The reason I have

swift setter causing exc_bad_access

岁酱吖の 提交于 2019-11-26 22:02:56
问题 I have a simple class below import Foundation public class UsefulClass: NSObject{ var test:NSNumber{ get{return self.test} set{ println(newValue) self.test = newValue } } override init() { super.init() self.test = 5; } } and I'm initializing it here import UIKit class ViewController: UIViewController { override func viewDidLoad() { super.viewDidLoad() var testClass = UsefulClass() } } But it results in xcode printing out 200 5s and then crashing due to EXC_BAD_ACCESS code = 2. Why does this

Break on EXC_BAD_ACCESS in XCode?

我的梦境 提交于 2019-11-26 18:39:02
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:12:14 jasonsmacbook TestProject[1289] : CGContextSetStrokeColorWithColor: invalid context Sun Oct 25 15:12:14 jasonsmacbook TestProject[1289] : CGContextSetLineWidth: invalid context Sun Oct 25 15:12:14 jasonsmacbook TestProject[1289] : CGContextAddPath: invalid

Enable and Debug Zombie objects in iOS using Xcode 5.1.1

牧云@^-^@ 提交于 2019-11-26 17:13:22
问题 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

EXC_BAD_ACCESS automatic handling

ぃ、小莉子 提交于 2019-11-26 15:58:34
问题 I'm trying to build my own signal and uncaught exception handler for iOS. To do this i use these two functions : NSSetUncaughtExceptionHandler(/*handler*/); and signal(/*signal const*/, /*signal handler*/); My problem is that i can't make it work with EXC_BAD_ACCESS signal. Is there some signal constant (like SIGABRT, SIGBUS) to catch the EXC_BAD_ACCESS? If no, how can i handle it? Some crash analytics tools (lika PLCrashReporter, Crashlytics etc.) can trace it... 回答1: EXC_BAD_ACCESS doesn't

EXC_BAD_ACCESS when building nspredicate

我是研究僧i 提交于 2019-11-26 09:12:45
问题 I am calculating the number of months between a birthdate and today. With that number, I am building a predicate to fetch objects from core data. Although the number of months is calculated correctly (as the log shows), I am getting a EXC_BAD_ACCESS when building the predicate. Here is my code: NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; NSUInteger unitFlags = NSMonthCalendarUnit; NSDateComponents *components = [gregorian components:unitFlags

What's the meaning of exception code “EXC_I386_GPFLT”?

给你一囗甜甜゛ 提交于 2019-11-26 06:19:23
问题 What\'s the meaning of exception code EXC_I386_GPFLT ? Does its meaning vary according to the situation? In that case, I\'m referring to exception type EXC_BAD_ACCESS with exception code EXC_I386_GPFLT The program is developed in Xcode 5.0.1, dealing with cblas_zgemm() of the BLAS library.(Well, I guess it doesn\'t matter...) Thank you very much! 回答1: EXC_I386_GPFLT is surely referring to "General Protection fault", which is the x86's way to tell you that "you did something that you are not