• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

ios - 地址簿链接器错误 : Undefined symbols for architecture i386

[复制链接]
菜鸟教程小白 发表于 2022-12-11 20:45:12 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题

当我使用 __bridge_transfer__bridge 时:

- (BOOL)peoplePickerNavigationControllerABPeoplePickerNavigationController *)peoplePicker
      shouldContinueAfterSelectingPersonABRecordRef)person 
{
    NSString* nameFirst = (__bridge_transfer NSString *)ABRecordCopyValue(person,
                                                   kABPersonFirstNameProperty);       
    NSString* nameLast = (__bridge_transfer NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
    _sight.contactName = [NSString stringWithFormat"%@ %@", nameFirst, nameLast];

    [self dismissModalViewControllerAnimated:YES];
    return NO;
}

上面的代码产生下面的错误:

Ld /Users/atencion/Library/Developer/Xcode/DerivedData/My_Guides-bgsawzdhvfxryifctnadtvdzotfx/Build/Products/Debug-iphonesimulator/Guides.app/Guides normal i386
    cd "/Users/atencion/Documents/Applications Development/Xcode Projects/Guides"
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator5.0.sdk -L/Users/atencion/Library/Developer/Xcode/DerivedData/My_Guides-bgsawzdhvfxryifctnadtvdzotfx/Build/Products/Debug-iphonesimulator -F/Users/atencion/Library/Developer/Xcode/DerivedData/My_Guides-bgsawzdhvfxryifctnadtvdzotfx/Build/Products/Debug-iphonesimulator -filelist "/Users/atencion/Library/Developer/Xcode/DerivedData/My_Guides-bgsawzdhvfxryifctnadtvdzotfx/Build/Intermediates/My Guides.build/Debug-iphonesimulator/Guides.build/Objects-normal/i386/Guides.LinkFileList" -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework AddressBookUI -framework MessageUI -framework Twitter -framework MediaPlayer -framework QuartzCore -framework CoreImage -framework MapKit -framework AudioToolbox -framework AVFoundation -framework MobileCoreServices -framework CoreLocation -framework UIKit -framework Foundation -framework CoreGraphics -framework CoreData -o /Users/atencion/Library/Developer/Xcode/DerivedData/My_Guides-bgsawzdhvfxryifctnadtvdzotfx/Build/Products/Debug-iphonesimulator/Guides.app/Guides

Undefined symbols for architecture i386:
  "_ABRecordCopyValue", referenced from:
      -[ContactInfoViewController peoplePickerNavigationController:shouldContinueAfterSelectingPerson:] in ContactInfoViewController.o
  "_kABPersonFirstNameProperty", referenced from:
      -[ContactInfoViewController peoplePickerNavigationController:shouldContinueAfterSelectingPerson:] in ContactInfoViewController.o
  "_kABPersonLastNameProperty", referenced from:
      -[ContactInfoViewController peoplePickerNavigationController:shouldContinueAfterSelectingPerson:] in ContactInfoViewController.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Addressbook 和 AddressbookUI 框架添加...



Best Answer-推荐答案


好的,问题是地址簿框架在我的项目中,但从“项目”-“摘要选项卡”-“链接的框架和库”中消失了。

添加框架后,所有问题都消失了。

关于ios - 地址簿链接器错误 : Undefined symbols for architecture i386,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8536591/

回复

使用道具 举报

懒得打字嘛,点击右侧快捷回复 【右侧内容,后台自定义】
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关注0

粉丝2

帖子830918

发布主题
阅读排行 更多
广告位

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap