Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Objective-C Help (how to find path to me)

Objective-C Help (how to find path to me)
Thread Tools
Dedicated MacNNer
Join Date: Dec 2003
Status: Offline
Reply With Quote
Dec 31, 2004, 02:21 AM
 
I know in Applescript, you can use path to me to get a path to the file. Is there any similar thing in Objective-C?

Also, is there any way to get a list of all mounted volumes in Objective-C?
15 inch MacBook Pro 2.16 GHz, 2 GB RAM, 7200 RPM 100GB HDD.

Dual 2.5 GHz Power Mac G5, 1 GB RAM, 250 GB HDD, ATI Radeon X800XT.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Dec 31, 2004, 04:18 AM
 
See the documentation for NSBundle and NSWorkspace.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Dedicated MacNNer
Join Date: Dec 2003
Status: Offline
Reply With Quote
Dec 31, 2004, 12:52 PM
 
I figured out how to use NSBundle to get the path to the executable, and how to use NSWorkspace. Thanks a lot.

One more question, how can I run a shell script using Objective-C?
15 inch MacBook Pro 2.16 GHz, 2 GB RAM, 7200 RPM 100GB HDD.

Dual 2.5 GHz Power Mac G5, 1 GB RAM, 250 GB HDD, ATI Radeon X800XT.
     
Clinically Insane
Join Date: Oct 2001
Location: San Diego, CA, USA
Status: Offline
Reply With Quote
Dec 31, 2004, 02:45 PM
 
Just as a piece of advice, you'd probably get things done a lot faster by looking through the documentation. In this case, NSTask is pretty much solely dedicated to running command-line programs.
Chuck
___
"Instead of either 'multi-talented' or 'multitalented' use 'bisexual'."
     
Professional Poster
Join Date: Oct 2001
Status: Offline
Reply With Quote
Dec 31, 2004, 03:35 PM
 
I'd recommend getting yourself a nice obj-c book like Aaron Hillegass's "Cocoa Programming for Mac OS X".
     
Dedicated MacNNer
Join Date: Dec 2003
Status: Offline
Reply With Quote
Jan 1, 2005, 02:07 AM
 
I have one more question (I ordered the book). How can I get a list of the contents of a directory?
15 inch MacBook Pro 2.16 GHz, 2 GB RAM, 7200 RPM 100GB HDD.

Dual 2.5 GHz Power Mac G5, 1 GB RAM, 250 GB HDD, ATI Radeon X800XT.
     
Professional Poster
Join Date: Dec 2000
Location: Chicago, Illinois
Status: Offline
Reply With Quote
Jan 1, 2005, 12:43 PM
 
Originally posted by KraziKid:
I have one more question (I ordered the book). How can I get a list of the contents of a directory?
NSFileManager
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:03 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2