• 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
NSOpenPanel question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSOpenPanel question


  • Subject: NSOpenPanel question
  • From: Raymund Beyer <email@hidden>
  • Date: Mon, 29 Jul 2002 20:23:10 +0200

Hi,

I'm just trying to get the path of a file into my app. I'm using the
following code. The 'openPanel filenames' method should return and
NSArray with pointers to NSString objects that contain the filepath(s).
For some reason I can't get the path copied from the 'fileNames' Array to
the NSString object called 'path'.

Does anyone have an idea why?

Thanks in advance

Ray


NSOpenPanel *openPanel = [NSOpenPanel openPanel];
NSMutableArray *fileTypes;
NSMutableArray *fileNames;
NSString *path;

fileTypes = [NSMutableArray arrayWithCapacity:1];
[fileTypes addObject:@"rtf"];

[openPanel runModalForTypes:fileTypes];
fileNames = [openPanel filenames];


path = [fileNames objectAtIndex: 0];

NSLog (@"\nfileNames:%@\nfileTypes:%@\npath:", fileNames, fileTypes,
path);


---------------------------------
Raymund Beyer
D3, 4
D-68053 Mannheim
Germany
email@hidden
http://www.brainstorm-music.com
http://www.ezee.de
---------------------------------
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: NSOpenPanel question
      • From: Robert Fischer <email@hidden>
References: 
 >Re: Dereferencing a pointer in ObjC? (From: Chris Hanson <email@hidden>)

  • Prev by Date: Re: NSToolbar messing with strings?
  • Next by Date: Re: NSTableView rows and delete key
  • Previous by thread: Re: Dereferencing a pointer in ObjC?
  • Next by thread: Re: NSOpenPanel question
  • Index(es):
    • Date
    • Thread