• 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
problems in runModal in NSOpenPanel used with defaults
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: problems in runModal in NSOpenPanel used with defaults
      • From: Corbin Dunn <email@hidden>
  • Prev by Date: Re: NSNotificationCenter
  • Next by Date: Fastest color detection in image?
  • Previous by thread: Re: NSNotificationCenter
  • Next by thread: Re: problems in runModal in NSOpenPanel used with defaults
  • Index(es):
    • Date
    • Thread