What is NSSearchPathForDirectoriesInDomains?

偶尔善良 提交于 2019-12-18 12:52:44

问题


[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]

I used to know that sending a message to the object is kind of calling the method. However, I can't recognize what is NSSearchPathForDirectoriesInDomains. Is it C style function? If yes then why among all message style calls we have thing kind of function?


回答1:


Yes, it's a plain C function taking and returning objective-c objects.

As to the why... Apple probably didn't find a nice class to put it in. :-) Seriously though, it could be a static method on UIApplication or NSApplication or similar, but it's hard to justify and quite system-specific (you'd have it in NSApplication on OS X and UIApplication on iOS).




回答2:


Check out http://www.techotopia.com/index.php/Working_with_Directories_on_iPhone_OS and http://iphonedevelopmentblog.blogspot.com/2011/03/documents-directory-file-path-iphone.html

I was studying the same material, and these links provide exhaustive information on the subject.



来源:https://stackoverflow.com/questions/3179527/what-is-nssearchpathfordirectoriesindomains

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!