Created
August 17, 2014 16:54
-
-
Save iteufel/28757cb1d7615d0981ca to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (NSDictionary*)argsToDictionary{ | |
//Get the arguments as an Array | |
NSMutableArray *arguments = [[NSMutableArray alloc]initWithArray:[[NSProcessInfo processInfo] arguments]]; | |
//remove the path | |
[arguments removeObjectAtIndex:0]; | |
//create the temp mutabledict | |
NSMutableDictionary *argsdict = [NSMutableDictionary dictionary]; | |
for (int i=0; i<arguments.count; i++) { | |
if (arguments.count > i+1){ | |
argsdict[arguments[i]] = arguments[i+1]; | |
i++; | |
} | |
} | |
return [NSDictionary dictionaryWithDictionary:argsdict]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment