Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Using Property Lists (Plists)

    • 0
    • 1
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 307
    Comment on it

    Method to get a value from plist

    NSString *path = [[NSBundle mainBundle] pathForResource:@"PlistX" ofType:@"plist"]; NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path]; int number = [[[[dict objectForKey:@"One"] objectForKey:@"Two"]objectForKey:@"Three"] intValue]; NSLog(@"%d",number);

    Writing to plist

    NSDictionary *dict; NSData *data = [NSPropertyListSerialization dataWithPropertyList:dict format:NSPropertyListXMLFormatv10 options:0 error:&error]; [data writeToFile:self.saveToPath atomically:YES];

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: