I am developing an iPhone application and i need to log the information about the images selected by the user to 开发者_如何学JAVAan external log file. How can this be achieved in iPhone?
I use Objective c for developing the application. I am not able to find out , which image the user has selected and get that information and write to the log file.
You can use NSFileHandle to write to a file.
NSFileHandle* fh = [NSFileHandle fileHandleForWritingAtPath:@"path/to/logfile"];
[fh seekToEndOfFile];
[fh writeData:[@"This is written" dataUsingEncoding:NSUTF8StringEncoding]];
[fh closeFile];
精彩评论