exc-bad-access

Using blocks causes EXC_BAD_ACCESS

给你一囗甜甜゛ 提交于 2019-12-04 17:10:46
I'd like to use blocks, but it causes me a EXC_BAD_ACCESS after a few calls. My code: - (void) sendBasket { if (currentSendToBasketBlock != nil) { // there's already a webservice going... set the new one as waiting waitingSendToBasketBlock = ^ { WebServicesModel *webServicesModel = [[[WebServicesModel alloc] init] autorelease]; webServicesModel.delegate = self; [webServicesModel sendBasketToServer:currentBasket]; [self showBasketBackground]; }; [waitingSendToBasketBlock copy]; } else { currentSendToBasketBlock = ^ { WebServicesModel *webServicesModel = [[[WebServicesModel alloc] init]

Core Data: -deleteObject: Crashes, Are Delete Rules the Cause?

夙愿已清 提交于 2019-12-04 13:25:44
I have the following model, as you can see in the image. alt text http://img521.imageshack.us/img521/9741/schermata20100224a12251.png My application requires refreshing every instance of B, so at each viewWillAppear , I need to delete all the B's in the model. Upon deleting a B, the cascade delete rule on the relationship to C will delete all C and then cascade to all D. A & E are constants. I have the DeleteRule on each object as follows: A: b - Cascade B: c - Cascade, a - Nullify C: b - Nullify, d - Cascade D: c - Nullify, e - Nullify E: d - Cascade or A -(cascade)->> B -(cascade)-> C -

EXC_BAD_ACCESS Crash in UITableView when number of rows is 0

限于喜欢 提交于 2019-12-04 07:56:13
I am having a consistent crash with my UITableView when I set the number of rows in the table to zero. It crashes with an EXC_BAD_ACCESS error. The crash is internal to the UITableView, so I cannot directly see what went wrong, though it should be a stupid mistake on my part. The stack trace is as follows: #0 0x0194ca60 in objc_msgSend () #1 0x00656837 in -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:] () #2 0x0064c77f in -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:] () #3 0x00661450 in -[UITableView(_UITableViewPrivate)

Delegate assignment causes EXC_BAD_ACCESS

妖精的绣舞 提交于 2019-12-04 06:52:27
问题 I am trying to create a delegate for an NSTextField in my view controller, but the program crashes with EXC_BAD_ACCESS . Why does this happen? I read that I am calling a non-existent object, but I don´t know what does not exist. I am using ARC. This is how the delegate object is created in my view controller: #import <Cocoa/Cocoa.h> #import "Delegate.h" @interface ViewController : NSViewController <NSTextFieldDelegate>{ } @end -- #import "ViewController.h" @implementation ViewController -

XCode 4 Not Breaking On Correct Line on EXC_BAD_ACCESS

我怕爱的太早我们不能终老 提交于 2019-12-04 03:48:26
I recently had my xcode upgraded to version 4, and I have an EXC_BAD_ACCESS exception in my code, but despite setting NSZombieEnabled in the environment it's still showing the break point on the thread1, int retVal = UIApplicationMain(argc, argv, nil, nil); line. I'm sure I had this configured in XCode 3 to stop on the line of my code that was causing the exception. Now it doesn't do that and displays no error messages in the GDB window either. Does anyone know what I might be missing? Thanks Ray EXC_BAD_ACCESS is not an exception, at least not as far as breakpoints are concerned - it means

Bad Access on [UICollectionView setCollectionViewLayout:animated:]

二次信任 提交于 2019-12-03 22:08:12
I'm getting a strange crash in my UICollectionView. The crashing UICollectionView is embedded in an UICollectionView cell of another UICollectionView. I can't reproduce the issue, it seems to happen sometimes if the inner UICollectionView get's newly initialized because the outer CollectionView is reloading it's cells. com.apple.main-thread Crashed 0 libobjc.A.dylib objc_msgSend + 9 1 UIKit -[UICollectionViewData _setLayoutAttributes:atGlobalItemIndex:] + 60 2 UIKit __45-[UICollectionViewData validateLayoutInRect:]_block_invoke_0 + 668 3 UIKit -[UICollectionViewData validateLayoutInRect:] +

UIWebView loading html5-Video EXC_BAD_ACCESS crash

℡╲_俬逩灬. 提交于 2019-12-03 13:34:49
in our iPad-App we are using an UIWebView to load different sites from one domain some of them with a hml5-Video. Sites without a Video do load perfectly. But when I'm loading a site containing htmlt5-video sometimes my app crashes during the loading-process of the UIWebView with EXC_BAD_ACCESS and sometimes it does not. Whenever such a crash occurs it seems to happen at the point where the Video-Player is added into the site. I did download the UICatalog-Example from Apple and just did change the Default-URL in the WebViewController-Class to a URL of a site containg html5-video. Same results

Cannot track down [NSData getBytes:length:] crash

坚强是说给别人听的谎言 提交于 2019-12-03 13:30:18
I got a strange EXC_BAD_ACCESS crash inside Foundation's -[NSData(NSData) getBytes:length:] method. It happens quite often, but I cannot get any meaningful information out of stack trace. There are no calls to getBytes:length: inside my code, except for open-source libraries (one in SDWebImage and one in SocketRocket ), but it doesn't seem like they're causing the crash. The only hint is that crash happens inside com.apple.CFNetwork.addPersistCacheToStorageDaemon thread, but I have no idea what is it about. Can someone help? Stacktrace from Crashlytics: Thread : Crashed: com.apple.CFNetwork

How to debug EXC_BAD_ACCESS in iPhone app when I can't determine the cause?

…衆ロ難τιáo~ 提交于 2019-12-03 13:15:23
问题 Help, I've been hacking at this for weeks now! I have this app I am developing in the Simulator, and I have done a lot of the UI stuff, it is just getting to the interesting part with data. It started immediately upon launch, about 90% of the time I run it, it will raise EXC_BAD_ACCESS exception. I have commented out all of my release messages, and even added some retain messages to be sure it is not something that is over released. Weird thing is, sometimes something I do in the code will

Swift set delegate to self gives EXC_BAD_ACCESS

China☆狼群 提交于 2019-12-03 11:42:37
I'm going through and learning Swift by porting an existing application. I'm stuck on setting a delegate and cannot work out what the issue is. I have a class which extends UITableViewCell import UIKit protocol SwitchCellDelegate{ func switchChanged(switchCell: SwitchCell, state: Bool) } class SwitchCell: UITableViewCell { @IBOutlet var swtSelector: UISwitch @IBOutlet var lblTitle: UILabel var delegate: SwitchCellDelegate? init(style: UITableViewCellStyle, reuseIdentifier: String) { super.init(style: style, reuseIdentifier: reuseIdentifier) } @IBAction func switchChanged(){ delegate?