我節省taxtfield保存價值的iOS
- (NSString *) getFilePath {
NSArray *pathArray = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
return [[pathArray objectAtIndex:0] stringByAppendingPathComponent:@"saved.plist"];
}
-(void) saveData {
NSArray *value = [[NSArray alloc] initWithObjects:[myTextField text],nil];
[value writeToFile:[self getFilePath] atomically:YES];
}
之日起的一個例子,但我怎麼能保存在文件中的變量的值?
NSInteger = record1, record2;
好建議(+1) –