使用 ARC 创建 KalViewController 对象? [英] Creating KalViewController object using ARC?

查看:29
本文介绍了使用 ARC 创建 KalViewController 对象?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我成功安装 &链接了 Kal Calendar 的静态库.但是,我正在努力在不使用 alloc & 的情况下创建日历对象.ARC 环境下的自动释放.我试图通过使用-fno-objc-arc"来关闭 ARC 选项......但它给了我'Apple Mach-O Linker(Id)错误'

I successfully installed & linked the static library of Kal Calendar. However, I'm struggling with creating a calendar object without using alloc & autorelease under ARC environment. I tried to turn off the ARC option by using "-fno-objc-arc" thing... but it gives me 'Apple Mach-O Linker (Id) Error'

有没有人成功地将它与 ARC 和故事板一起使用?:'(

Did anyone succeed to use it with ARC and storyboard? :'(

已这是我收到的错误消息.

Edited: This is the error msg I got.

Ld Test.app/测试正常 i386cd/用户/Phrixus/桌面/测试setenv MACOSX_DEPLOYMENT_TARGET 10.6setenv 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/Phrixus/Desktop/Test -F/Users/Phrixus/Desktop/Test -filelist/Users/Phrixus/Library/Developer/Xcode/DerivedData/Test-cwrxnjyllxlrlmczaymhzykteqlq/Build/Intermediates/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/i386/Test.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Objc -all_load -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework 框架/基础框架 UI GraphusKit桌面/测试/Test.app/Test

Ld Test.app/Test normal i386 cd /Users/Phrixus/Desktop/Test 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/Phrixus/Desktop/Test -F/Users/Phrixus/Desktop/Test -filelist /Users/Phrixus/Library/Developer/Xcode/DerivedData/Test-cwrxnjyllxlrlmczaymhzykteqlq/Build/Intermediates/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/i386/Test.LinkFileList -mmacosx-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 -Objc -all_load -fobjc-arc -Xlinker -no_implicit_dylibs -D__IPHONE_OS_VERSION_MIN_REQUIRED=50000 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/Phrixus/Desktop/Test/Test.app/Test

架构 i386 的未定义符号:_OBJC_CLASS_$_KalViewController",引用自:CalendarViewController.o 中的 objc-class-refld:找不到架构 i386 的符号clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Undefined symbols for architecture i386: "_OBJC_CLASS_$_KalViewController", referenced from: objc-class-ref in CalendarViewController.o ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

推荐答案

正如我所怀疑的,这不是 ARC 问题.

As I suspected, this isn't an ARC problem.

您正在为模拟器构建,但您尝试链接到的库是为设备创建的.

You're building for the simulator but the library you're attempting to link to is for the device.

或者 A) 弄清楚如何构建和安装与模拟器兼容的 KalViewController 版本并链接到它.

Either A) Figure out how to build and install a simulator-compatible version of KalViewController and link against it.

或 B)

确保库确实包含在内.换句话说,是否选中了 libKal.a 目标复选框?我为你做了一些谷歌搜索,找到了其他人似乎已经解决了你遇到的同样问题.

Make sure the library is truly included. In other words, is the libKal.a target checkbox checked? I did a bit of Googling for you and found somebody else who appears to have solved the same problem that you have.

这篇关于使用 ARC 创建 KalViewController 对象?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆