Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

bobber205

macrumors 68020
Original poster
Nov 15, 2005
2,183
8
Oregon
I've started getting serious about learning Cocoa today. I've found the API to be easy to use, but requiring alot of research to know the sometimes very long method names etc.

What resources aside from Apple's site do you use?

My main question is how do you "open" a file in Cocoa. Right now I have a NSOpenPanel that's working as I want, but how do I have the "OS" open that file? Like as if I've opened it on the desktop.
 
I've started getting serious about learning Cocoa today. I've found the API to be easy to use, but requiring alot of research to know the sometimes very long method names etc.

What resources aside from Apple's site do you use?

My main question is how do you "open" a file in Cocoa. Right now I have a NSOpenPanel that's working as I want, but how do I have the "OS" open that file? Like as if I've opened it on the desktop.
First of all, turn on code completion in Xcode, it will make your life a lot easier in regards to remembering long method names. The resource I use most is the built-in Documentation in Xcode (Help menu). I strongly recommend you go through one of the Cocoa books and I would start with Aaron Hillegass' Cocoa Programming for Mac OS X.

To open a file, use the NSWorkspace method openFile: or openFile:fromApplication:, or if you need additional things you can always launch using a UNIX command (like open) wrapped in an NSTask object.
 
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
Oh man. Code completion. I've been using VS for about the last year or so steady and I've missed it today.

Thank god Xcode has it. :D

I am ordering the book tonight. :)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.