在Objective-C中创建iPhone联系人

在Objective-C中创建iPhone联系人,iphone,addressbook,Iphone,Addressbook,我正在尝试在内部通讯簿中创建联系人。我的代码如下: 在CreateNewAccountPage.h文件中: #import <UIKit/UIKit.h> #import <Foundation/Foundation.h> #import <AddressBook/AddressBook.h> #import <AddressBookUI/AddressBookUI.h> .... @interface CreateNewAccountPage :

我正在尝试在内部通讯簿中创建联系人。我的代码如下:

在CreateNewAccountPage.h文件中:

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>
#import <AddressBook/AddressBook.h>
#import <AddressBookUI/AddressBookUI.h>
....
@interface CreateNewAccountPage : UIViewController <UIScrollViewDelegate,
UITextViewDelegate, MainMenuDelegate, ABNewPersonViewControllerDelegate> {
....
}

- (IBAction)goToContactCreation;
...
@end
我得到的错误是:

“_OBJC_CLASS_$_ABNewPersonViewController”,引用自: CreateNewAccountPage.o中ABNewPersonViewController的objc类引用 ld:找不到符号 collect2:ld返回了1个退出状态

如果我注释掉这些行:

ABNewPersonViewController *picker = [[ABNewPersonViewController alloc] init];
picker.newPersonViewDelegate = self;
...
[picker release];
我不再收到错误。我只是想建立一个联系人。这与访问联系人列表无关。我只需要一个按钮来创建联系人


非常感谢

将AddressBook.framework、AddressBookUI.framework框架添加到项目中。

将AddressBook.framework、AddressBookUI.framework框架添加到项目中

ABNewPersonViewController *picker = [[ABNewPersonViewController alloc] init];
picker.newPersonViewDelegate = self;
...
[picker release];