On May 20, 2009, at 10:23 PM, Bruce Johnson wrote:

I have a unix path in an NSString via [[NSBundle bundleForClass: [self
class]] pathForResource:  etc.. etc..
The problem is that the path has white spaces scattered in the string.
And I need to pass the unix path to a CLI application.  The CLI app
croaks on the white spaces (for obvious reasons)

Is there a standard Cocoa way of escaping the white spaces like is
done in the Terminal Application (I'm not looking for percent escapes)
that has eluded my searches today?

I also would like it to work in both Leopard and iPhone.


Well, if you're firing off the command line app from within your Cocoa app, typically you'd be using NSTask and simply pass the string as an argument without having to escape it. There's no built-in way to escape strings for a shell because Cocoa doesn't interact with any shell instances and what has to be escaped depends on the destination.



--
Seth Willits



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to