Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > NSSavePanel problem

NSSavePanel problem
Thread Tools
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Aug 25, 2004, 09:56 AM
 
I think this will be an easy problem, but in my quest for even cooler programs, I have decided to implement a NSSavePanel. Here is my code:

-(void)openSavePanel
{
NSSavePanel *save = [NSSavePanel savePanel];
[save setRequiredFileType:@"inv"];
[save beginSheetForDirectory:@""
file:@""
modalForWindow:window
modalDelegate:self
didEndSelector:@selector(savePanelDidEnd:returnCod e:contextInfo:)
contextInfo:NULL];
}

- (void) savePanelDidEnd:(NSSavePanel *)savePanel returnCode:(int)returnCode contextInfo:(void *)contextInfo
{
NSLog(@"code = %d", returnCode);
[savePanel orderOut:nil];
}

I get the following errors:

-[NSMutableRLEArray savePanelDidEnd:returnCode:contextInfo:]: selector not recognized

Exception raised during posting of notification. Ignored. exception: *** -[NSMutableRLEArray savePanelDidEnd:returnCode:contextInfo:]: selector not recognized

The Save Sheet does show and these errors come up when I hit Save... Any ideas???
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Aug 25, 2004, 02:58 PM
 
Sounds like your object that implements -openSavePanel and -savePanelDidEnd::: is getting dealloc'ed between when you invoke the save panel and when the user dismisses it.
Rick Roe
icons.cx | weblog
     
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Aug 26, 2004, 10:50 AM
 
Doh!
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 01:11 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2