Even though i know there are at least 2 or 3 topics with this name, i didnt find a proper answer so far to my problem : I want to edit a Plist (which has been created by zwoptex (image/animations program)) in order to divide every number in it by 2. So in my plist i do have some keys like "spriteOffset" with {{182, 160}, {58,75}} or {192, 165} as value. Those are NSStrings, and i just want to modify the numbers so i need to check if there's a "{" or a space or such, then casting the number. The thing is i don't really know how to do it..... Also, it seems that i'm missing something with my plist management. I've put some NSLogs for displaying every of those strings in my plist, but.... nothing gets displayed... So here is my code :
-(void)DivideValues
{
for(NSString * plistName in plistSubpathsByName)
{
NSMutableDictionary* infoDict = [NSMutableDictionary dictionaryWithContentsOfFile:[NSString stringWithFormat:@"%@.plist",plistName]];
for(NSDictionary * sprite in [infoDict objectForKey:@"frames"])
{
for(NSString * string in [infoDict objectForKey:@"spriteColorRect"])
{
NSLog(@"%@",string);
}
for(NSString * string in [infoDict objectForKey:@"spriteOffset"])
{
NSLog(@"%@",string);
}
for(NSString * string in [infoDict objectForKey:@"spriteSize"])
{
NSLog(@"%@",string);
}
for(NSString * string in [infoDict objectForKey:@"spriteSourceSize"])
{
NSLog(@"%@",string);
}
for(NSString * string in [infoDict objectForKey:@"textureRect"])
{
NSLog(@"%@",string);
}
}
}
}
Thanks for any response, and i wish you all good luck for your career/passion