Re: some NSThread questions
Re: some NSThread questions
- Subject: Re: some NSThread questions
- From: Charles PARNOT <email@hidden>
- Date: Wed, 2 Jun 2004 16:10:14 -0700
you can do both:
*have two targets in the same project, so you can more easily share some classes
*add the tool to the Resources folder of the App, by adding a 'Copy Files' step to the target
For step 2 in XCode, click on your app target, go the the menu 'Project-->New Build Phase-->New Copy Files Build Phase', and choose in the info window where to put it (if you put it in 'Resources' then you can get it back in your app code with the NSBundle method pathForResource:ofType:).
Just remember, when you modify a class used by both targets (app and tool), to rebuild first the tool, and then the app, so the latest version of the classes are used when you call the tool from the app. You need to do that even when you modify a class used by the tool. You first rebuild the tool, then rebuild the app. In the second step, no compiling is done, but the new version of the tool is bundled, so the app will run the newest version.
good luck,
charles
>
On Jun 1, 2004, at 11:16 PM, Louis C. Sacha wrote:
>
>2) running the code that is used in the detached thread as a tool instead, using NSTask, since as a seperate process the task is easier to control from outside code.
>
>
>
>The second option (using a separate task) is significantly better than the first (turning off the output), but it might not be very efficient if you are dealing with large amounts of data that are already loaded into your application's memory.
>
>
>
>
That also sounds like a good plan. I did some reading on NSTask and all the example codes I found use an unix application in /usr/bin. Can I also use NSTask with an application that is in the same XCode project? If yes, can I just add the compiled binary to the Resources folder? Or should I make two targets in the same XCode project , one for the command line tool, and one for the Cocoa GUI?
>
>
thanks,
>
>
- Koen.
>
_______________________________________________
>
cocoa-dev mailing list | email@hidden
>
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
>
Do not post admin requests to the list. They will be ignored.
--
Charles PARNOT
email@hidden
Help science go forward:
http://cmgm.stanford.edu/~cparnot/xgrid-stanford/
Room B157 in Beckman Center
279, Campus Drive
Stanford University
Stanford, CA 94305 (USA)
Tel +1 650 725 7754
Fax +1 650 725 8021
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.