Relative, absolute path it is necessary to make an analogy: like you on the same floor of the neighbor Beauty said: I live 202, evening to my home for dinner. She can find it, and you say this to the strange woman who meets on the street, and if she wants to make a date, she will ask you: which section of the Unit is 202? See? Then, [UIImage imagenamed:@ "Haha.png"], is the relative path, the program internal processing. The equivalent of your beautiful neighbor. And, [Videodata Writetofile:fullpath Atomically:no]; This fullpath need absolute path, the equivalent of that beautiful woman on the street, how to know fullpath? [[NSBundle Mainbundle] pathforresource:@ "Spark" oftype:@ "MP3"]; This can return an absolute path. Directory structure:------appname.app------Documents------Library----------Caches----------Preferences------tmp------Document S: Used to store user data or other information that should be backed up regularly preferences: application Preferences File caches: Saves the information that is needed during application startup. Your application usually needs to be responsible for adding and removing these files, but itunes will delete these files during full recovery of the device TMP: Store temporary files and save information that is not needed during the application startup process
Nothing is more than the official picture:
https://developer.apple.com/library/ios/documentation/FileManagement/Conceptual/FileSystemProgrammingGuide/ Filesystemoverview/filesystemoverview.html#//apple_ref/doc/uid/tp40010672-ch2-sw2
iOS-relative path absolute PATH directory structure