0
您可以告诉我在数组中输入的文件字符串,然后您必须更改此数组中的元素。这样做:项目更改NSMutableArray
NSMutableArray *user;
...
NSString* filePath1 = @"user";
NSString* fileRoot1 = [[NSBundle mainBundle] pathForResource:filePath1 ofType:@"txt"];
NSString* fileContents1 =[NSMutableString stringWithContentsOfFile:fileRoot1 encoding:NSUTF8StringEncoding error:nil];
user = [fileContents1 componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
money= [user[0] intValue]-2;
user[0]=[NSString stringWithFormat:@"%d",money];
发誓
- [__NSArrayI ReplaceObjectAtIndex: withObject:]: unrecognized selector sent to instance 0x12fd4270