Firstly you call the function NSSearchPathForDirectoriesInDomains(). This function returns an array however there will almost always only be one object within the array.
NSArray*NSSearchPathForDirectoriesInDomains(NSSearchPathDirectorydirectory,NSSearchPathDomainMaskdomainMask,BOOLexpandTilde );
The reference for the method is shown above.The Directory value must be one of the predefined search path directories of the operating system. The most commonly used directory and the one we'll use here is the documents directory which the value for is NSDocumentDirectory. Other values can be seen in the documentation here.The domain mask value is most often NSUserDomainMask meaning the returned path is local to the user's home directory. Other possible values are shown below. NSUserDomainMask - Local to the user's home directory. NSLocalDomainMask - local to the current machine. NSNetworkDomainMask - Publicly available location in the local area network. NSSystemDomainMask - /System (Usually unused private). NSAllDomainsMask - will return a path for each of the above domains.The full example of how to obtain a string of the system file path to the user documents directory is shown below. -(NSString *)documentsDirectoryPath {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectoryPath = [paths objectAtIndex:0];
return documentsDirectoryPath;
}
Hello,
ReplyDeleteThe first thing you should do when looking to hire a freelance iPhone developer is to outline what type of development you need done for the iPhone.
hire iphone Developer
I posted a question on StackOverflow about NSSearchPathForDirectoriesInDomains - it's returning the wrong directory. Do you know why this would be happening? http://stackoverflow.com/questions/6515979/nssearchpathfordirectoriesindomains-returns-the-wrong-directory
ReplyDeleteI have read this post. collection of post is a nice one ..that am doing website designing company chennai india and website development company chennai india. That I will inform about your post to my friends and all the best for your future posts..
ReplyDeleteNow day's demand of iPhone application is increasing very fast. This is the appropriate blog for any iPhone developer who wants to outsource their iPhone application development.
ReplyDelete