problems in runModal in NSOpenPanel used with defaults
problems in runModal in NSOpenPanel used with defaults
- Subject: problems in runModal in NSOpenPanel used with defaults
- From: "spartan g" <email@hidden>
- Date: Fri, 26 Sep 2008 15:41:42 +0530
Hi,
I am writing an utility which needs to open a panel to browse files and
select one.
- (IBAction)browseClicked:(id)sender
{
NSOpenPanel *panel = [NSOpenPanel openPanel];
if ([panel runModal]) {
NSArray *filenames = [panel filenames];
NSString *filename = [filenames objectAtIndex:0];
if (filename){
printf("\n browseClicked: filename = %s \n", [filename cString]);
if ([appToOpenText stringValue] != NULL ){
[appToOpenText setStringValue: filename];
}
else printf("\n browseClicked: appToOpenText has NULL value \n");
}
else printf ("\n *** browseClicked: Filename is NULL *** \n");
}
}
The filename chosen is assigned to the textfield. I have used defaults to
synchronize this filename and storing it in a pList file.
[_defaults setObject: [appToOpenText stringValue] forKey: @"AppToOpen" ];
[_defaults synchronize];
But whenever I click Browse plIst file is automatically updated with the
following junk values
What could be the possible reasons to this problem, please help.
Thanks,
Sparta...
_______________________________________________
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