 |
|
SwiftSandbox
V2EX member #134955, joined on 2015-08-25 11:41:29 +08:00
|
I've been coding iOS apps since 2008, when the first iPhone was released. I started one of the first iOS developer blogs (
iOSDeveloperTips.com) and recently started a free, weekly, Swift developer Newsletter (
http://SwiftSandbox.io).
SwiftSandbox's recent replies
Enter the code inside a Mac app and you can read the command line parameters. Is that what you are looking for help with?
To read Mac app command line arguments:
NSUserDefaults *standardDefaults = [NSUserDefaults standardUserDefaults];
NSString *strArg = [standardDefaults stringForKey:@"str"];
NSInteger intArg = [standardDefaults integerForKey:@"x"];
// Examples: here is command line with app and two parameters
yourApp -str "StringArg" -x 99