• 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
Code -NSSavePanel, background-only app, "Replace?" alert ordering
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Code -NSSavePanel, background-only app, "Replace?" alert ordering


  • Subject: Code -NSSavePanel, background-only app, "Replace?" alert ordering
  • From: Dave Hersey <email@hidden>
  • Date: Sat, 07 Feb 2004 10:58:29 -0500

Oh my, sorry. One more try...

I edited the code for emailing and broke it.

The code should have read:


// Called as: [self reportError: @"Error detail."];

- (void) reportError: (NSString *) errorDetail
{
CFOptionFlags responseFlags;

CFUserNotificationDisplayAlert(0, kCFUserNotificationCautionAlertLevel,
nil, nil, nil,
(CFStringRef) @"An error occurred.",
(CFStringRef) @"Click \"Save Report\" to save an error report.",

(CFStringRef) @"Save Report",
(CFStringRef) @"Cancel",
nil, &responseFlags);

if ((responseFlags & 0x03) == kCFUserNotificationDefaultResponse)
{
NSSavePanel *savePanel = [NSSavePanel savePanel];
int bt;

[savePanel makeKeyAndOrderFront: self];
bt = [savePanel runModalForDirectory: @"/" file: @"Error Report.txt"];

if (bt == NSOKButton)
{
// Save the report.
NSString *newFileString;

newFileString =
[[NSString alloc] initWithFormat: @"echo \'%@\' > \'%@\'",
errorDetail, [savePanel filename]];

system([newFileString UTF8String]);
[newFileString release];
}
}
}
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: NSSavePanel, background-only app, "Replace?" alert ordering
  • Next by Date: Re: [Q] NSScanner -> \t\t how to fix??
  • Previous by thread: NSSavePanel, background-only app, "Replace?" alert ordering
  • Next by thread: Weird Threads
  • Index(es):
    • Date
    • Thread