相关疑难解决方法(0)

为什么在用作格式参数时,必须将NSInteger变量强制转换为long?

NSInteger myInt = 1804809223;
NSLog(@"%i", myInt); <==== 
Run Code Online (Sandbox Code Playgroud)

上面的代码产生错误:

Values of type "NSInteger" should not be used as format arguments: add an explicit cast to 'long' instead.
Run Code Online (Sandbox Code Playgroud)

正确的NSLog消息实际上NSLog(@"%lg", (long) myInt);为什么我要将myInt的整数值转换为long,如果我想要显示该值?

xcode casting objective-c

141
推荐指数
3
解决办法
4万
查看次数

xcode 5.1中的Arm64架构

在新的XCode 5.1中,arm64已成为构建的标准架构之一.

但是,在我目前的项目中,我包含了尚未支持这种新架构的库(例如Google AdMob) - 这些现在导致链接器错误:

ld: symbol(s) not found for architecture arm64
Run Code Online (Sandbox Code Playgroud)

据说谷歌AdMob 6.8.0 支持arm64,但我不能确认这一点,除非cputype (16777228) cpusubtype (0)是arm64?(通过文件命令行工具找到)

libGoogleAdMobAds.a: Mach-O universal binary with 5 architectures
libGoogleAdMobAds.a (for architecture armv7):   current ar archive random library
libGoogleAdMobAds.a (for architecture armv7s):  current ar archive random library
libGoogleAdMobAds.a (for architecture i386):    current ar archive random library
libGoogleAdMobAds.a (for architecture x86_64):  current ar archive random library
libGoogleAdMobAds.a (for architecture cputype (16777228) cpusubtype (0)):   current ar archive random library
Run Code Online (Sandbox Code Playgroud)

有办法解决这个问题吗?

xcode objective-c ios xcode5.1

63
推荐指数
4
解决办法
7万
查看次数

标签 统计

objective-c ×2

xcode ×2

casting ×1

ios ×1

xcode5.1 ×1