Re: CoreFoundation Command Line Tool - an easy beginner question
Re: CoreFoundation Command Line Tool - an easy beginner question
- Subject: Re: CoreFoundation Command Line Tool - an easy beginner question
- From: David Duncan <email@hidden>
- Date: Mon, 4 Aug 2008 12:10:49 -0700
On Aug 4, 2008, at 11:51 AM, Steve Cronin wrote:
Folks;
I open new project using the CoreFoundation - Command Line Tool
template, and place the code shown above.
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
My guess would be that the compiler thinks its compiling C (or C++)
code, when you've given it Obj-C. Simplest fix if that is the case is
to change the file extension to ".m". But without seeing the actual
errors, it would have to remain a guess.
Alternatively, you can keep this all in the land of C by using
CFURLCreateWithFileSystemPath() and CFStringCreateWithCString(). Then
you won't need any Obj-C (or Foundation) at all.
Of course, while I realize this is probably a learning project, the
same thing can be accomplished with the "open" command line tool :).
--
David Duncan
Apple DTS Animation and Printing
email@hidden
_______________________________________________
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