Folks;

Here's the pretty simple tool I'm trying to create (THANK-YOU Michael Ash!!)

int main (int argc, const char * argv[]) {
        char dummy;
        read(STDIN_FILENO, &dummy, 1);
        [NSAutoreleasePool new];
NSURL *url = [NSURL fileURLWithPath:[NSString stringWithUTF8String:argv[1]]];
        LSOpenCFURLRef((CFURLRef)url, NULL);
        return 0;
}

I'm using XCode3.1 with the 10.5 SDK deploying to 10.4.
I open new project using the CoreFoundation - Command Line Tool template, and place the code shown above.

My question is what are the #imports necessary to make this work?
I have figured out:
#import <unistd.h>                                                              
  //for the STDIN_FILENO and the read()
#import <ApplicationServices/ApplicationServices.h> //for the LSOpenCFURLRef

I've tried various usages of #import <Foundation/Foundation.h> but can't seem to get it right so that NSURL & NSAutoreleasePool are defined... I believe that both NSURL and NSAutoreleasePool are defined in the Foundation framework, which is why I am focused on getting it #imported, I just need the syntax..
(with Foundation framework added to the project)
NO --> #include <Foundation/Foundation.h>  (~700 errors...)
NO --> #include <Foundation/NSURL.h>  (45 errors..)

Oh out of exasperation, I tried <Cocoa/Cocoa.h> ---> ~1700 errors

I know this is probably pretty easy for most, but its got me just bamboozled....

THANK-YOU for any help!
Steve
_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to