NSRunAlertPanel, Correct Usage
NSRunAlertPanel, Correct Usage
- Subject: NSRunAlertPanel, Correct Usage
- From: "digital.pardoe" <email@hidden>
- Date: Wed, 6 Sep 2006 17:03:59 +0100
Hi,
I wish to have my application receive a users response on the very
first run of an application. I found the code that provided me with a
way to do this in the Sparkle updater framework and have implemented
it so that it works successfully;
NSNumber *defaultsVar = [[NSUserDefaults standardUserDefaults]
objectForKey:@"MyDefault"];
if (!defaultsVar)
{
defaultsVar = [NSNumber numberWithBool:NSRunAlertPanel
(SULocalizedString(@"Enable control?"), [NSString
stringWithFormat:SULocalizedString(@"Would you like control to be
enabled?")], SULocalizedString(@"Yes"), SULocalizedString(@"No"),
nil) == NSAlertDefaultReturn];
[[NSUserDefaults standardUserDefaults] setObject:defaultsVar
forKey:@"MyDefault"];
}
Essentially I want to remove the references to the 'Sparkle' method;
SULocalizedString
I have read the documentation for NSRunAlertPanel, looked at other
examples and tried a few different ways (probably wrong) of
implementing the strings but they never compile. Even with the above
I get the error 'makes pointer from integer without a cast'.
Could someone advise me as how to correct this, or how to correctly
implement it to perform what I would like it to do?
Thanks in Advance,
Alex
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden