If this is your first time reading this, you probably haven't signed up yet. Do so now by clicking here.

Members Login

Username:
Password:
Remember me ?      

Advertisement

Recommended Books

Partner Links

Forum - iDevApps » Mac, iPhone, iPad & iPod Development » APIs, Frameworks, & SDKs » Double NSWindows

APIs, Frameworks, & SDKs Discussion and reference for Apple & third-party technologies.

Reply
Old 2004.11.19, 06:24 PM   #1
Jake
Level 4
 
Jake's Avatar
 
Join Date: Mar 2005
Posts: 184
Default Double NSWindows

I am getting some reports of multiple windows coming up. After my second round of golf I start to see them too, here is the code

Code:
                    NSWindow *infoWindow = NSGetAlertPanel( @"Score", @"Triple Bogey", @"Crap.", nil, nil );
                    [NSApp runModalForWindow:infoWindow ];
                    [infoWindow close];
On the first round of golf it waits until you close it to go to the next hole, but on the second round I think (not going to play 18 holes to test) it waits for the first window to be closed but not the second.

Any ideas? I am almost 100% sure my program only hits that piece of code once.
Jake is offline   Reply With Quote
Old 2004.11.19, 09:21 PM   #2
Steven
Moderator
 
Join Date: Feb 2005
Location: Los Altos, CA
Posts: 720
Default

Stick a NSLog in to make sure it's only called once. And aren't you supposed to use orderOut: and not close?
Steven is offline   Reply With Quote
Old 2004.11.19, 09:56 PM   #3
Jake
Level 4
 
Jake's Avatar
 
Join Date: Mar 2005
Posts: 184
Default

Thanks Steven, that showed me two errors. First the orderOut fixed the multiple windows, but the NSLog was getting called as many times as you played the game, so that made me realize that I wasn't turning off the timer each game!
Jake is offline   Reply With Quote
Old 2004.11.20, 03:10 AM   #4
Taxxodium
Moderator
 
Taxxodium's Avatar
 
Join Date: Mar 2005
Location: Belgium
Posts: 324
Default

Instead of creating a window each time, why don't you use NSBeginAlertSheet()?
__________________
"execute order 66"
Taxxodium is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 06:40 AM.