CoreFoundation Command Line Tool - an easy beginner question
CoreFoundation Command Line Tool - an easy beginner question
- Subject: CoreFoundation Command Line Tool - an easy beginner question
- From: Steve Cronin <email@hidden>
- Date: Mon, 04 Aug 2008 13:51:42 -0500
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 (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