- (void)viewDidLoad {//读取plistNSString *path = [[NSBundle mainBundle] pathForResource:@”demo” ofType:@”plist”];NSMutableDictionary *data = [[NSMutableDictionary alloc] initWithContentsOfFile:path];NSLog(@”%d”,[data count]);//添加一项内容[data setObject:@"content" forKey:@"item4"];//获取应用程序沙盒的Documents目录NSArray *paths=NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,NSUserDomainMask,YES);path = [paths objectAtIndex:0];//得到完整的文件名NSString *filename=[path stringByAppendingPathComponent:@"test.plist"];[data writeToFile:filename atomically:YES];[data release];[super viewDidLoad];}