菜鸟教程小白 发表于 2022-12-11 20:45:12

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


                                            <p><p>当我使用 <code>__bridge_transfer</code> 或 <code>__bridge</code> 时:</p>

<pre><code>- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker
      shouldContinueAfterSelectingPerson:(ABRecordRef)person
{
    NSString* nameFirst = (__bridge_transfer NSString *)ABRecordCopyValue(person,
                                                   kABPersonFirstNameProperty);      
    NSString* nameLast = (__bridge_transfer NSString *)ABRecordCopyValue(person, kABPersonLastNameProperty);
    _sight.contactName = ;

    ;
    return NO;
}
</code></pre>

<p>上面的代码产生下面的错误:</p>

<pre><code>Ld /Users/atencion/Library/Developer/Xcode/DerivedData/My_Guides-bgsawzdhvfxryifctnadtvdzotfx/Build/Products/Debug-iphonesimulator/Guides.app/Guides normal i386
    cd &#34;/Users/atencion/Documents/Applications Development/Xcode Projects/Guides&#34;
    setenv MACOSX_DEPLOYMENT_TARGET 10.6
    setenv PATH &#34;/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin&#34;
    /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 &#34;/Users/atencion/Library/Developer/Xcode/DerivedData/My_Guides-bgsawzdhvfxryifctnadtvdzotfx/Build/Intermediates/My Guides.build/Debug-iphonesimulator/Guides.build/Objects-normal/i386/Guides.LinkFileList&#34; -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:
&#34;_ABRecordCopyValue&#34;, referenced from:
      - in ContactInfoViewController.o
&#34;_kABPersonFirstNameProperty&#34;, referenced from:
      - in ContactInfoViewController.o
&#34;_kABPersonLastNameProperty&#34;, referenced from:
      - 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)
</code></pre>

<p>Addressbook 和 AddressbookUI 框架添加...</p></p>
                                    <br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
                                            <p><p>好的,问题是地址簿框架在我的项目中,但从“项目”-“摘要选项卡”-“链接的框架和库”中消失了。</p>

<p>添加框架后,所有问题都消失了。</p></p>
                                   
                                                <p style="font-size: 20px;">关于ios - 地址簿链接器错误 : Undefined symbols for architecture i386,我们在Stack Overflow上找到一个类似的问题:
                                                        <a href="https://stackoverflow.com/questions/8536591/" rel="noreferrer noopener nofollow" style="color: red;">
                                                                https://stackoverflow.com/questions/8536591/
                                                        </a>
                                                </p>
                                       
页: [1]
查看完整版本: ios - 地址簿链接器错误 : Undefined symbols for architecture i386