exc-bad-access

EXC_BAD_ACCESS Using IBInspectable

那年仲夏 提交于 2019-12-20 05:50:18
问题 I am trying to use IBInspectable to add borders to my views. extension UIView { private func getBorder(integer: Int) -> UIRectEdge { if integer == 1 { return .top } else if integer == 2 { return .left } else if integer == 3 { return .right } else if integer == 4 { return .bottom } return .all } @IBInspectable var border: Int? { get { return self.border } set (value) { self.border = value for v in addBorder(edges: self.getBorder(integer: self.border!)) { self.addSubview(v) } } } @IBInspectable

drawRect:/renderInContext: issues

送分小仙女□ 提交于 2019-12-19 11:55:07
问题 Seem to be having a bit of an issue trying to draw my view into a context. My basic setup is, I have a view controller that owns a UIPageViewController in which I load controllers with views that can be drawn on by the users finger. Basically I have a book that can be drawn in. When the page is turned in the book I save the image by calling - (UIImage *)wholeImage { // Render the layer into an image and return UIGraphicsBeginImageContext(self.bounds.size); [self.layer renderInContext

EXC_BAD_ACCESS EXC_I386_GPFLT while click on button

大兔子大兔子 提交于 2019-12-19 09:50:03
问题 i have a UIViewController with UITableView , when the tableView is empty i want to show another view so i am using this [self.tableView setHidden:YES]; NoKidsViewController *noKids = [self.storyboard instantiateViewControllerWithIdentifier:@"NoKidsView"]; [self.view addSubview:noKids.view]; all is fine, i'm able to see the view. but when i tap on one of the buttons in it i'm getting the EXC_BAD_ACCESS EXC_I386_GPFLT error. //NoKidsViewController - (IBAction)addNewKid:(id)sender { AddKid

UIPickerView EXC BAD ACCESS?

时光毁灭记忆、已成空白 提交于 2019-12-19 09:26:27
问题 I keep getting a exc bad access error and I think it has something to do with my UIPickerView because this is when the app crashes. Everything works fine until I make a 9th choice from the UIPickerView. Every single time the app crashes on the 9th choice. Any ideas? - (void)viewDidLoad { [super viewDidLoad]; list = [[NSMutableArray alloc] init]; [list addObject:@"Anvil"]; [list addObject:@"Apple"]; [list addObject:@"Arrow"]; [list addObject:@"Baby"]; [list addObject:@"Basketball"]; [list

EXC_BAD_ACCESS on objc_setAssociatedObject with -weak_library /usr/lib/libSystem.B.dylib linker flags

二次信任 提交于 2019-12-19 02:46:09
问题 I have a EXC_BAD_ACCESS when I call objc_setAssociatedObject with the linker flags : -weak_library /usr/lib/libSystem.B.dylib linker flags. I absolutely need the linker flag because of this, do somebody know a workaround? (I also have a crash on dispatch_async but I can work around that... Also, I'm building a iOS 4 only feature on my app that is iOS 3 compatible) EDIT: With more research, I found this and this question but no more answer... 回答1: The problem is simply a bug in the iOS

Post of NSNotificationCenter causing “EXC_BAD_ACCESS” exception

↘锁芯ラ 提交于 2019-12-18 10:58:15
问题 A UIViewController adds itself to the default center: [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(editFood) name:@"editFood" object:nil]; Then a UITableView delegate NSObject posts a NSNotification : [[NSNotificationCenter defaultCenter] postNotificationName:@"editFood" object:self]; During run time it get a EXC_BAD_ACCESS exception. Is the defaultCenter getting released somewhere? The same concept works when I post a notification to a UIViewController from a

My App calls scrollViewDidScroll 19 times

。_饼干妹妹 提交于 2019-12-18 07:40:52
问题 I have an app based on Apple's PageControl sample. The first time the view loads, the scroll view is loaded with page 0 and page 1. Whenever a scroll is initiated, the scrollViewDidScroll method should get called by UIKit correct? When initiating a scroll from page 0 to page 1, the app should load page-1, page and page+1, (to prevent flashes during scrolling). My app seems to call scrollViewDidScroll 19 times and my loadScrollViewWithPage: method 19 times each with page 0 and page 1, before

UINavigationController crash because of pushing and poping UIViewControllers

百般思念 提交于 2019-12-17 21:13:25
问题 The issue: I have a UINavigationController as as subview of UIWindow, a rootViewController class and a custom MyViewController class. The following steps will get a Exc_Bad_Access, 100% reproducible.: [myNaviationController pushViewController:myViewController_1stInstance animated:YES]; [myNaviationController pushViewController:myViewController_2ndInstance animated:YES]; Hit the left back tapBarItem twice (pop out two of the myViewController instances) to show the rootViewController. After a

Re-Assigning instance of AVAudioPlayer in iOS13 leads to BAD_ACCESS runtime error

蹲街弑〆低调 提交于 2019-12-17 16:48:35
问题 Hey guys , unfortunately I stuck and after trying a lot of things the last three days , I have to ask for help here. I have an app, that is for many years in the AppStore and runs without any crashes (last deployment target iOS 12.4). I have some code for playing a sound on certain events in the app. Now I tried to upgrade my app for iOS 13 and without changing any code related to that “playSound” thing, I always get this runtime error , when testing on a real device . Does not happen on

EXC_BAD_ACCESS message sent to deallocated instance, but I'm using ARC?

我与影子孤独终老i 提交于 2019-12-17 15:38:53
问题 I've got an app that gets information from a SOAP web service and I want to display the results in a UITableView . I had a previous version of this app and I'm creating a new version to basically clean things up and get rid of a bunch of legacy code that's deprecated and no longer used. In the previous version, this worked well. In the new version, not so much. Basically, the current scenario is returning 3 strings that I'm trying to use as the basis for the data in my UITableView . I'm