简体   繁体   English

如何使用XCode链接iPhone开发框架?

[英]How to link a framework for iPhone development using XCode?

I'm new to iPhone development and Xcode, so this might be really obvious. 我是iPhone开发和Xcode的新手,所以这可能很明显。

I have the exact same problem as referenced on this forum post 我有与此论坛帖子中提到的完全相同的问题

I've created a simple list application, starting out with a custom datasource class that simply returns a hard-wired list of data. 我创建了一个简单的列表应用程序,从一个自定义数据源类开始,该类仅返回硬连接的数据列表。 With that working, I'm now attempting to alter my datasource class to pull data from the address book. 通过该工作,我现在尝试更改我的数据源类以从通讯簿中提取数据。 I've added a reference to AddressBook/ABAddressBook.h and created an ABAddressBookRef variable. 我添加了对AddressBook / ABAddressBook.h的引用,并创建了ABAddressBookRef变量。 The application compiles fine with that, and I'm able to get Code Sense into the ABAddressBook API. 应用程序可以很好地编译,并且我可以将Code Sense导入ABAddressBook API。 However, if I attempt to initialize my ABAddressBookRef variable by calling ABAddressBookCreate(), I get a link error like this: 但是,如果我尝试通过调用ABAddressBookCreate()初始化ABAddressBookRef变量,则会收到如下所示的链接错误:

"_ABAddressBookCreate", referenced from: -[TestTableDataSource init] in TestTableDataSource.o symbol(s) not found collect2: id returned 1 exit status 从以下位置引用“ _ABAddressBookCreate”:-在TestTableDataSource.o中未找到符号-[TestTableDataSource init] collect2:id返回1退出状态

The answer to the problem is that he didn't linked the entire framework (see thread)... but what does that mean and how do you do that? 问题的答案是他没有链接整个框架(请参阅线程)...但是那意味着什么,以及如何做到这一点?

Is this as simple as right-clicking on the "Frameworks" folder, choosing "Add existing Framework" and then navigating to the framework that should be included? 就像在“ Frameworks”文件夹上单击鼠标右键,选择“添加现有框架”,然后导航到应包含的框架一样简单吗? (usually two, IIRC, for Address Book). (对于地址簿,通常为两个,即IIRC)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM