gpt4 book ai didi

ios - 是否有一种行之有效的系统方法来了解在使用类(class)时我应该包括哪些内容

转载 作者:行者123 更新时间:2023-11-29 10:56:05 26 4
gpt4 key购买 nike

看看这个例子:

SLServiceTypeTwitter

在某处声明

文档说它是在SLRequest.hSL服务类型.h

那么我到底应该包括什么?

我应该怎么做

#import <SLRequest.h>

什么?

SLRequest.h 很可能是框架的一部分。什么框架?我怎么知道?

我经常发现这个问题。我经常做出很好的猜测。啊我愿意

#import <Accounts/Accounts.h>

但事实并非如此。它不起作用。

我应该包括什么?

是否有系统的方法来找到我应该包含的内容?

这是用于 xcode

注意:根据有根据的猜测,我发现我应该这样做

#import <Social/Social.h>

但我他妈的怎么知道的?我想我可以找到 SLRequest.h 并看到它是社交框架的一部分,并意识到我应该包含一个与框架同名的 .h 文件。

另一种猜测方式是看 SL 听起来很像社交。

我想知道我的方法是否是官方知道的方法。

最佳答案

查找SLServiceTypeTwitter在文档中将引导您到 SLRequest Class Reference ,在最顶部显示它是“Social.framework”的一部分。

来自"Including Frameworks in Your Project"在里面“框架编程指南”(强调我的):

When including framework header files, it is traditional to include only the master framework header file. The master header file is the header file whose name matches the name of the framework. For example, the Address Book framework has a master header file with the name AddressBook.h. To include this header in your source, you would use the following directive:

#import <AddressBook/AddressBook.h>

在您的情况下,社交框架的“官方”导入是

#import <Social/Social.h>

关于ios - 是否有一种行之有效的系统方法来了解在使用类(class)时我应该包括哪些内容,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18374085/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com