我很难过或只是找不到我需要的信息,我有一个对象,当他们选择“saveDataround”按钮时,我想将其保存在数组中,但是我似乎无法弄清楚如何用文本填充对象“ Round”:我得到一个“Expected identifier”和“Expected , ;” 第一行和第二行代码的错误。提前致谢。
[NSString *roundChoice = [NSString stringWithFormat:@"Round"];
self.round.text = roundChoice;]
- (IBAction)saveDataround {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *recipient = [NSString stringWithFormat:@"%@/arrayChoiceRound", documentsDirectory];
NSMutableArray *array = [[NSMutableArray alloc] init];
[array addObject:round.text];
[array writeToFile:recipient atomically:NO];
}