什么是NSSearchPathForDirectoriesInDomains? [英] What is NSSearchPathForDirectoriesInDomains?

查看:125
本文介绍了什么是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可能找不到适合的类.:-)不过,认真的说,它可能是UIApplicationNSApplication或类似方法上的静态方法,但是很难以证明其合理性和特定于系统(您可以在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆