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 > Assigning file types in Cocoa

Assigning file types in Cocoa
Thread Tools
Forum Regular
Join Date: Jan 2002
Location: Hungary
Status: Offline
Reply With Quote
Jan 8, 2002, 01:42 PM
 
Hey everyone!

This must sound pretty darn stupid, but since I'm a newbie and am experimenting with the examples provided with the Apple Developer Tools Documentation, but I can't figure out where you specify the file types to save to or open in save/open panels. I looked at the SimpleToolbar example, which can save simple rtf files and open them, but can't find the related code !

Maybe some of you can send me some advice on this one...

thanks guys,
nothing is when everything is alright
stupidfish23@mac.com ICQ: 153647416
     
Forum Regular
Join Date: Jan 2002
Location: Hungary
Status: Offline
Reply With Quote
Jan 10, 2002, 03:06 AM
 
Anyone?

Please...

nothing is when everything is alright
stupidfish23@mac.com ICQ: 153647416
     
Junior Member
Join Date: Dec 2001
Location: My own personal purgatory
Status: Offline
Reply With Quote
Jan 10, 2002, 09:25 PM
 
If I understand correctly, the method for an open panel looks like:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>
- (void)beginSheetForDirectoryNSString *)path
fileNSString * name)
typesNSArray *)types
modalForWindowNSWindow *)docWindow
modalDelegateid)delegate
didEndSelectorSEL)didEndSelector
contextInfovoid *)contextInfo
</font>[/code]

types is where you can specify the file types to be allowed for opening. This can be a array of strings generated by you, or it can be an automatically generated one (for example, "types:[NSImage imageFileTypes]".

(For more info, see Cocoa Developer Documentation -&gt; File, Resource and Process Management -&gt; Application File Management -&gt; NSOpenPanel (or NSSavePanel))
"A scientist can discover a new star but he cannot make one. He would have to ask an engineer to do it for him."
     
Forum Regular
Join Date: Jan 2002
Location: Hungary
Status: Offline
Reply With Quote
Jan 11, 2002, 02:23 AM
 
Thanks!

I'll take a look at it in a few hours when I get home from work...

?
nothing is when everything is alright
stupidfish23@mac.com ICQ: 153647416
     
   
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 09:41 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