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: "Michael Ash" <email@hidden>
- Date: Mon, 4 Aug 2008 17:00:56 -0400
On Mon, Aug 4, 2008 at 3:10 PM, David Duncan <email@hidden> wrote:
> 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 :).
I think you may have missed the read() at the beginning of the
function, which is critical to the operation of the tool. (The purpose
is to wait for the parent process to quit, then restart it.) If,
however, I have instead missed a way to make the "open" tool wait for
its parent to die before opening the argument, I would very much
appreciate enlightenment on that subject.
Mike
_______________________________________________
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