Re: Passing non-string user defaults through command line arguments
Re: Passing non-string user defaults through command line arguments
- Subject: Re: Passing non-string user defaults through command line arguments
- From: "Justin C. Walker" <email@hidden>
- Date: Tue, 05 Apr 2011 15:21:22 -0700
Hi, Christian,
On Apr 5, 2011, at 09:53 , Christiaan Hofman wrote:
> Sometimes I want to test my app with a particular value for a user default. I do this by adding a command line argument (in the info for the executable in Xcode) for the user default key. This works for string values, however when the value needs to be something else (e.g. a boolean), I cannot get this to work. Is there a way to do this?
No. Using the command line (shell), argument passing is always done with strings, so you have to translate in the command. If you want to fuss with fork/exec, you could write a tester that would fuss with the child's address space with (the moral equivalent of) ptrace(), but that's kind of gnarly. Since the kernel does the work in exec(), that's where the semantics of argument-passing is "enforced", so it's just not easy to do (arguments are assumed to be strings, and that is how the kernel deals with them).
At least, that's my best guess.
HTH
Justin
--
Justin C. Walker, Curmudgeon-At-Large
Institute for the Enhancement of the Director's Income
--------
When LuteFisk is outlawed,
Only outlaws will have LuteFisk
--------
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden