-
Notifications
You must be signed in to change notification settings - Fork 393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bad access when using [alert setButtonTitles:NULL]; #32
Comments
thanks @TomDoes, |
Hey this is in xcode 5 ios 7.0.x tried it on devices and simulator. I figured it might have something to with NULL or nil, however both result in a bad access. I tested your more defensive code and it doesn't fix the BAD ACCESS When i remove the setButtons line it works fine again, but with a close button. |
getting weirder. if you want, you can try to change the CustomIOS7AlertView's init function to be
(instead of buttonTitles = @[@"Close"];), that would do the same as setting it to nil with setButtonTitles. perhaps that gives you more insight in the problem. if not, feel free to share some more code, i'll try to look at it. in private, you can find me on twitter by the @wimagguc handle.) |
Well, setting buttonTitles = nil in the init fixes the bad access problem. |
is it an arc project? |
Yes, it's an arc project. It's weird, for now i'll leave it like this. If I encounter similar problems later on, or the source of the bad access i'll let you know. Thanks for looking into it! |
haha no worries. i'll close this for now, but just fire up a new ticket if you have more details on this. |
I'm using a custom alertView to indicate the loading of a UIWebView but it crashes with a bad access message. Without the setButtonTitles line it works fine.
-(void)webViewDidStartLoad:(UIWebView *)webView
{
alert = [[CustomIOS7AlertView alloc]initWithParentView:self.view];
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithFrame:CGRectMake(0,10,240,100)];
[spinner startAnimating];
UIView *demoView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 240, 100)];
UILabel *label =[[UILabel alloc]initWithFrame:CGRectMake(0, -30, 240, 100)];
}
The text was updated successfully, but these errors were encountered: