Re: runModalForWindow, best solution to modal session
Re: runModalForWindow, best solution to modal session
- Subject: Re: runModalForWindow, best solution to modal session
- From: Alexander Reichstadt <email@hidden>
- Date: Tue, 13 Jan 2009 20:21:09 +0100
Hi Keary,
On 13.01.2009, at 19:44, Keary Suska wrote:
On Jan 13, 2009, at 10:44 AM, Alexander Reichstadt wrote:
Hi,
in my app I call runModalForWindow: in a class method initializer --
the class is a NSWindowController subclass-- from a controller of a
sheet. Please, disregard UI Guidelines, it's a highly customized
app and this approach used as per specific request.
+ (id)selectItem
{
KSingleItemSelectorController *newSelector =
[[KSingleItemSelectorController alloc]
initWithWindowNibName:@"SingleItemSelector"];
(void)[newSelector window];
NSLog(@"The window is nil, see: %@",[newSelector window]);
[NSApp runModalForWindow:[newSelector window]];
id keepThis = newSelector.returnValue;
[newSelector release];
return keepThis;
}
<snipped>
Is the class of the File's Owner of the nib set to
KSingleItemSelectorController
Yes.
and its window outlet set?
Yes
If so, do you override -initWithWindowNibName:? The implementation
may matter.
No, I only override initWithWindow. Should I override it, and if so
should I call on NSBundle to load my nib there then?
Alex
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden