• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
NSRunAlertPanel, Correct Usage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: NSRunAlertPanel, Correct Usage
      • From: Sean Murphy <email@hidden>
  • Prev by Date: Help Linking To A Framework
  • Next by Date: Re: Programatically detect if any autorelease pool exists?
  • Previous by thread: Re: Help Linking To A Framework
  • Next by thread: Re: NSRunAlertPanel, Correct Usage
  • Index(es):
    • Date
    • Thread