• 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
Re: NSBeginAlertSheet (II)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSBeginAlertSheet (II)


  • Subject: Re: NSBeginAlertSheet (II)
  • From: Prachi Gauriar <email@hidden>
  • Date: Mon, 20 Dec 2004 22:08:37 -0600


On Dec 20, 2004, at 7:52 PM, Matt Jaffa wrote:

Isn't the first parameter the title (which is required/@""), with the last
being an optional (can-be-nil) message? In the sheets docmentation
(Presenting A Series of Sheets), the example (deleteSelectedRows) code
snippet shows the message (last parameter) being nil.

void NSBeginAlertSheet(NSString *title, NSString *defaultButton, NSString *alternateButton, NSString *otherButton, NSWindow *docWindow, id modalDelegate, SEL didEndSelector, SEL didDismissSelector, void *contextInfo, NSString *msg, ...)

With this function signature, title may be nil and msg may not be nil.

However, I did try adding "errorMsg" as the last parameter (w/ and w/o the
first parameter being nil), but no sheet comes up.

I noticed earlier that when you called the function, you put nil for the optional parameter to the message format string. That is, you had 11 arguments with the last being nil, when only 10 parameters are required... any after that are for the msg format string. The 10th parameter may not be nil.


This works for me:

NSBeginAlertSheet(nil, nil, nil, nil, window, self, NULL, NULL, NULL, @"A Message");

Changing the last argument to nil gives the following in the Run Log:

2004-12-20 21:58:29.308 SheetTest[677] *** Assertion failure in -[NSTextFieldCell _objectValue:forString:], AppKit.subproj/NSCell.m:1131
2004-12-20 21:58:29.313 SheetTest[677] Invalid parameter not satisfying: aString != nil


-Prachi

_______________________________________________
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: NSBeginAlertSheet (II)
      • From: mark <email@hidden>
References: 
 >Re: NSBeginAlertSheet (II) (From: mark <email@hidden>)
 >Re: NSBeginAlertSheet (II) (From: Matt Jaffa <email@hidden>)

  • Prev by Date: Re: Toolbar bug?
  • Next by Date: Re: NSBeginAlertSheet (II)
  • Previous by thread: Re: NSBeginAlertSheet (II)
  • Next by thread: Re: NSBeginAlertSheet (II)
  • Index(es):
    • Date
    • Thread