The following methods are all in the APPDELEGATE.M
-(void) redirectnslogtodocumentfolder{
NSString *filename =[nsstringstringwithformat:@ "%@.log", [Nsdatedate]];
NSString *logfilepath = [Document_pathstringbyappendingpathcomponent:filename];
Freopen ([LogFilePath cstringusingencoding:nsasciistringencoding], "A +", stderr);
}
-(BOOL) applicationuiapplication *) Application didfinishlaunchingwithoptionsnsdictionary *) launchOptions
{
make a real-machine debug Save log file
Uidevice *device =[uidevicecurrentdevice];
if (![ [Device model] isequaltostring:@ "IPad Simulator"]) {
[Selfredirectnslogtodocumentfolder];
}
Project configuration Shared files
You can use the following steps to enable the application to support file sharing: Add the Uifilesharingenabled key to the application's Info.plist file and set the key value to Yes. Place the files you want to share in the documents directory of your application. Once the device is plugged into the user's computer, ITunes 9.1 displays a file sharing area in the Apps tab of the selected device. The user can then add files to the directory or move the files to the desktop computer. If the application supports file sharing, the application should be able to recognize and respond appropriately when the file is added to the documents directory. For example, an application can display the contents of a new file on the interface. Do not present a list of directories to the user and ask them what they want to do with the file.
Then through real-machine debugging, view shared files via itunes
IOS Other-NSLog logs are saved to the document directory when the real machine is debugged