Re: running an external app
Re: running an external app
- Subject: Re: running an external app
- From: Graham Cox <email@hidden>
- Date: Tue, 27 May 2008 13:41:20 +1000
This is starting to get a bit old.
If you learn Cocoa in a logical order, i.e start with the language,
then the basic concepts and build on each step, there is no confusion
here, because by the time you get to using NSWorkspace you can
recognise an Obj-C method when you see one and so there's no conscious
effort needed to "translate" to the way you invoke it.
Since you need to do this a thousand times a day when writing Obj-C
code, you'd better "get it" early on.
Also, how are any other languages any different? In C++, a function
prototype also doesn't look like the way it's invoked:
virtual void launchApplication( const TString& aString );
vs.
workspace->launchApplication(TString::string("Interface Builder"));
Same in any other computer language you care to name.
hth,
G.
On 27 May 2008, at 1:29 pm, Johnny Lundy wrote:
Now the line
- (BOOL)launchApplication:(NSString *)appName
May be technically the declaration of the method, but is that really
useful to anybody? After all, you do not declare this method in your
code; you just invoke it. I can't tell you how many times I have
been led astray by this terminology - took me at least a year to
figure out that the way it is written has nothing to do with how you
use it.
The way you would use it is something like
(BOOL) loadedIB = [[NSWorkspace sharedWorkSpace] launchApplication:
@"Interface Builder"];
Which bears no resemblance to the line that is written in the
documentation.
_______________________________________________
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