什么是NSSearchPathForDirectoriesInDomains? [英] What is NSSearchPathForDirectoriesInDomains?
问题描述
[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject]
我曾经知道向对象发送消息是一种方法的调用.但是,我不知道什么是NSSearchPathForDirectoriesInDomains
.是C风格的功能吗?如果是,那为什么在所有message
样式调用中我们都有某种功能?
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?
推荐答案
是的,它是一个普通的C函数,用于接收和返回Objective-C对象.
Yes, it's a plain C function taking and returning objective-c objects.
关于原因... Apple可能找不到适合的类.:-)不过,认真的说,它可能是UIApplication
或NSApplication
或类似方法上的静态方法,但是很难以证明其合理性和特定于系统(您可以在OS X的NSApplication
和iOS的UIApplication
中使用它.)
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).
这篇关于什么是NSSearchPathForDirectoriesInDomains?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!