// ================================================ ==========================================================
Nsstring * defaultdbpath = [[nsbundle mainbundle] resourcepath] stringbyappendingpathcomponent: Filename];
// ================================================ ==========================================================
// Obtain the program documents directory path// Directory list
Nsarray * paths = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes );
// Root directory
Nsstring * documentsdirectory = [paths objectatindex: 0];
// ================================================ ==========================================================
// Obtain the program library directory path// Directory list
Nsarray * paths = nssearchpathfordirectoriesindomains (nslibrarydirectory, nsuserdomainmask, yes );
// Root directory
Nsstring * documentsdirectory = [paths objectatindex: 0];
// ================================================ ==========================================================
// Obtain the caches directory of the programNsarray * cache = nssearchpathfordirectoriesindomains (nscachesdirectory, nsuserdomainmask, yes );
Nsstring * cachepath = [cache objectatindex: 0];
// ================================================ ==========================================================
// Obtain the file path doucument Based on the file name-(Nsstring *) datafilepath :( nsstring *) sender
{
Nsarray * Path = nssearchpathfordirectoriesindomains (nsdocumentdirectory, nsuserdomainmask, yes );
Nsstring * documentdirectory = [path objectatindex: 0];
Return [documentdirectory stringbyappendingpathcomponent: sender];
}
// ================================================ ==========================================================
// Obtain the directory path of the app file.
Nsstring * homepath = nshomedirectory ();
// ================================================ ==========================================================
// Obtain the tmp directory path of the program
Nsstring * temppath = nstemporarydirectory ();
// ================================================ ==========================================================
// Obtain the application package path
Nsstring * Path = [[nsbundle mainbundle] resourcepath];
// Or
Nsstring * Path = [[nsbundle mainbundle] pathforresource: @ "info" oftype: @ "TXT"];
// ================================================ ========================================================== // ================================================ ========================================================== // ================================================ ==========================================================