Skip to content
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

SDCAlertController crashes if title is nil #59

Closed
jasperblues opened this issue Oct 19, 2014 · 9 comments
Closed

SDCAlertController crashes if title is nil #59

jasperblues opened this issue Oct 19, 2014 · 9 comments
Labels

Comments

@jasperblues
Copy link

AFAIK the default iOS component does not.

@sberrevoets
Copy link
Owner

Could you post the code you use to initialize the alert? I'm not able to reproduce in the sample project by just leaving the title empty.

@jasperblues
Copy link
Author

Sorry for the delay. Here's the code:

A method on the Root (container) view controller:

- (void)presentMessage:(NSString *)message
{
    dispatch_async(dispatch_get_main_queue(), ^
    {
        SDCAlertController
            *alert = [SDCAlertController alertControllerWithTitle:nil message:message preferredStyle:SDCAlertControllerStyleAlert];
        [alert setVisualStyle:[INFAlertStyle style]];

        [alert addAction:[SDCAlertAction actionWithTitle:@"OK" style:SDCAlertActionStyleDefault handler:nil]];
        [alert presentWithCompletion:nil];
    });
}

And here's the stack:

2014-10-20 17:03:27.123 Infiniti[247:12504] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSConcreteAttributedString initWithString:: nil value' 
*** First throw call stack: 

@sberrevoets
Copy link
Owner

Thank you, very helpful. I'll investigate and let you know!

@jasperblues
Copy link
Author

👍

@sberrevoets
Copy link
Owner

I wish attributed strings would just take a nil string when allocated...

Anyway, fixed now, will release a CocoaPods update shortly. Thanks for your input and fast response time!

@jasperblues
Copy link
Author

You're welcome. Thanks for the great library. Will send some details of our app when published.

@sberrevoets
Copy link
Owner

Ah yeah, I'm very interested! Can never really tell if an app uses it or not. Maybe I should edit the license to require attribution..

@jasperblues
Copy link
Author

We use the Apache 2.0 license for our projects. It has an attribution clause, but even if the App complies strictly with this, and displays license info (like iOS' "General/About in settings does) we'd still have to check each app individually. . . the information does not necessarily feed back.

Also I think it would be a disincentive for some users. . Still, you're certainly within your rights (both legally and in an ethical sense) to ask for this if it interests you.

@sberrevoets
Copy link
Owner

Yeah, I don't want it to disincentivize people from using the library. Maybe I'll just add a "Attribution is much appreciated" text to the README or something.

@sberrevoets sberrevoets added the bug label Nov 3, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants