I'm trying to write the state of a UISwitch to file, so every time the app starts up it remembers whether it was on or off previously.
-(IBAction) switchValueChanged {
if (Hard1ON.on) {
isH1 = (@"YES");
//save above yes to file
After a bit of searching, I found this is the piece of code used to save to file:
- (BOOL)writeToFile:(NSString *)path atomically:(BOOL)useAuxiliaryFile encoding:(NSStringEncoding)enc error:(NSError **)error
However it is evoking a 'Use of undeclared identifier 'writeToFile' error. Can anyone tell me what's wrong?