exc-bad-access

EXC_BAD_ACCESS right after touchesBegan

馋奶兔 提交于 2019-12-25 02:39:07
问题 I have started a very simple project to learn iOS programming, but I get EXC_BAD_ACCESS after touchesBegan . You can download the project from DropBox here . I basically have a UIView subclass that should draw circles wherever the user is touching. Very simple but I cannot make it work. Any help is highly appreciated. Thanks! EDIT Turns out the problem is this line of code in touchesBegan : ts = [NSMutableSet setWithSet: [event touchesForView:self]]; That I changed into: ts = [[NSMutableSet

EXC_BAD_ACCESS at searchbar when there are 2 Words?

99封情书 提交于 2019-12-25 01:52:58
问题 The problem is when I write a Letter like "Pasar" the error not showing, but when I press space the error like exc_bad_access showing, why can it be? any one can't tell me about exc_bad_access.. I'am using xcode 4.2 and build at iPhone 5.0 Simulator. 回答1: Try using NSZombies. In your project info, set NSZombieEnabled to YES. Read this to enable NSZombie in your project. Its just a memory management problem. You'll be releasing something earlier and then using it or you'll be using some

Custom delegate not working

梦想与她 提交于 2019-12-25 01:11:41
问题 I have started working more with delegate as suggested in another question I made. Now, I have made a UIViewController called ProfileViewController in which I would like to load the News Feed from Facebook. I also have subclass of NSObject called FBFeed . This subclass loads the Facebook News Feed and should pass it back to the view controller. All my requests to Facebook are sent through a singleton named FBRequestWrapper which (in this case) should pass the result to FBFeed . I call

Swift: Unacceptable type of value for attribute when creating new NSEntity

佐手、 提交于 2019-12-25 01:09:06
问题 I have a Core Data entity set up with the following attributes: resellerNo:Int resellerName:String I have setup an NSManagedObject as follows: class Reseller: NSManagedObject { @NSManaged var resellerNo: Int @NSManaged var resellerName: String } If I try to run this method: func createNewReseller(resellerName: String) { let context = app.managedObjectContext let resellerEntity = NSEntityDescription.entityForName("Resellers", inManagedObjectContext: context) let newReseller = Reseller(entity:

memory bad access?

放肆的年华 提交于 2019-12-25 00:21:50
问题 How can this statement ever give me bad access? myWebView = [[NewsWebViewController alloc] initWithNibName:@"NewsWebViewController" bundle:nil]; [[self.view.superview superview] addSubview:myWebView.view]; if(myWebView!=nil) { [myWebView release]; myWebView = nil; } Ive ran it through instruments and it crashes every time. myWebView is an ivar in my header file. Any thoughts? Many thanks Jules 回答1: ok here is the actual issue. When I removed the webview it gets dealloc'd but I didnt set its

ios:crash in 64 bit device

99封情书 提交于 2019-12-24 17:46:29
问题 Can someone explain why my app crashes with the following error: EXC_BAD_ACCESS(Code = 1, address= ...) This crash occurs only in 64 bit devices. I am not able to figure it out. - (NSString *)getIPAddress { NSString *address = nil; struct ifaddrs *interfaces = NULL; struct ifaddrs *temp_addr = NULL; int success = 0; // retrieve the current interfaces - returns 0 on success success = getifaddrs(&interfaces); if (success == 0) { // Loop through linked list of interfaces temp_addr = interfaces;

BAD ACCESS after block within a block is called (iOS)

不羁岁月 提交于 2019-12-24 13:40:31
问题 I have a block where I am checking a user's status property from firebase. If the status property is 'free' I want to return from the block, otherwise I want to search for another user and check their status and do so until a 'free' user has been found: void( ^ myResponseBlock)(BOOL finished) = ^ void(BOOL finished) { if (finished) { if ([self.freedom isEqualToString: @"free"]) { NSLog(@"free!"); return; } else if ([self.freedom isEqualToString: @"matched"]) { NSLog(@"get another user"); /

Exc_Bad_Access in alertview show

浪子不回头ぞ 提交于 2019-12-24 11:24:44
问题 Getting Exc_Bad_Access in UIAlertView show message. UIAlertView *systemAlert1 = [[UIAlertView alloc]initWithTitle:@"System message" message:@"note" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil]; [systemAlert1 show]; **//Crashing on this line [EXC_BAD_ACCESS]** [systemAlert1 release]; Why i am getting this?? Please help 回答1: ANY UI stuff including the showing of alerts should be done on Main thread. If you are doing this on some other thread, it will definitely crash. 回答2: It may

Canon EDSDK 2.11 on OSX EdsOpenSession exc_bad_access

时光毁灭记忆、已成空白 提交于 2019-12-24 07:08:10
问题 I'm trying to use the Canon EDSDK 2.11 on OSX with a EOS Xsi. I tried running the sample code, I've written my own code, and I even downloaded openFrameworks and an add-on for the Canon EDSK, ofxCanon, and ran its sample code. Every time any of the code reaches a call to EdsOpenSession I get a exc_bad_access error. Can anyone tell me what might be going on and what I might be doing wrong? 回答1: I had the same problem. It seems there is some issues with the SDK downloaded from Canon site. Here

Issues with NSOperationQueue and dealloc being called and crashing App

家住魔仙堡 提交于 2019-12-24 07:03:27
问题 I've created an NSOperation in the queue like so: ImageLoadingOperation *operation = [[ImageLoadingOperation alloc] initWithImageURL:url target:self action:@selector(didFinishLoadingImageWithResult:)]; [operationQueue addOperation:operation]; [operation release]; And this works fine but if the view gets popped before the operation finishes the App crashes with "EXC_BAD_ACCESS" I've tried to cancel the the operation Queue by calling cancelAllOperations but as its already in process it doesn't