NSMutableArray *stories = [NSMutableArray new];
NSArray *keys = [NSArray arrayWithObjects:@"name", @"read", @"callme", @"image", @"details", nil]; // Set the key values for each field
// Create a story dict and add them to the array
[stories addObject:[NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"title", @"read total", @"Tel", @"http://url image /0490_web.gif",@"content details", nil] forKeys:keys]];
//If u need to add second details repeat the above step
// Saving .plist file
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *filePath = [documentsDirectory stringByAppendingPathComponent:fileName.plist];
[stories writeToFile:filePath atomically:YES];
來源
2014-04-02 04:19:18
LML
誰告訴的,其多用的NSDictionary。在給出答案之前,先研究一下。 @hoang – Ramdy