如何将用户选择的图像信息记录到iPhone中的日志文件中 [英] how to log image info selected by the user to the log file in iPhone
本文介绍了如何将用户选择的图像信息记录到iPhone中的日志文件中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在开发iPhone应用程序,我需要将有关用户选择的图像的信息记录到外部日志文件中.在iPhone中如何实现?
I am developing an iPhone application and i need to log the information about the images selected by the user to an external log file. How can this be achieved in iPhone?
我使用Objective c来开发应用程序.我找不到用户选择的图像,并获取该信息并将其写入日志文件.
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];
这篇关于如何将用户选择的图像信息记录到iPhone中的日志文件中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文