- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个应用程序,其中添加了一些新功能。这是在 Debug模式下进行测试的,但在编译发布时引入了许多错误。
一些侦探工作表明这些是由在 NSView 类和 CALayer 类之间转换点的调用引起的,例如
- (NSPoint)convertPoint:(NSPoint)aPoint fromView:(NSView *)aView
- (CGPoint)convertPoint:(CGPoint)aPoint toLayer:(CALayer *)layer
error: incompatible type for argument 1 of 'convertPoint:toLayer:'
尝试纠正此问题导致将一组错误替换为另一组错误,我在 NSPoint 中发现了问题:-
Prior to Mac OS X v10.5 the coordinates were represented by float values rather than CGFloat values. When building for 64 bit systems, or building 32 bit like 64 bit, NSPoint is typedef’d to CGPoint.
我一直在编译默认的“标准(32/64 位英特尔)”架构,将其更改为“64 位英特尔”解决了问题。我可以通过在 NSPoint 和 CGPoint 之间包含显式转换来解决该问题,尽管这很笨拙(并且在 64 位中是不必要的)。
我试图找出“标准(32/64 位英特尔)”架构的实际含义,但一无所获。我唯一能找到的是这个:-
A list of the architectures for which the product will be built. This is usually set to a predefined build setting provided by the platform. If more than one architecture is specified, a universal binary will be produced.
查看应用程序包似乎没有显示标准(32/64 位 Intel)和 64 位 Intel 之间有太大差异。
任何人都可以阐明这一点吗?尝试在面向 10.6 或更高版本的应用程序中生成“标准(32/64 位英特尔)”有什么意义吗?
最佳答案
A bit of detective work showed these were caused by calls to convert a point between the NSView class and the CALayer class e.g.
- (NSPoint)convertPoint:(NSPoint)aPoint fromView:(NSView *)aView
- (CGPoint)convertPoint:(CGPoint)aPoint toLayer:(CALayer *)layer
error: incompatible type for argument 1 of 'convertPoint:toLayer:'Attempts to correct this resulted in exchanging one set of errors for another, and I discovered the problem in NSPoint:-
Prior to Mac OS X v10.5 the coordinates were represented by float values rather than CGFloat values. When building for 64 bit systems, or building 32 bit like 64 bit, NSPoint is typedef’d to CGPoint.
正确。构建 32 位时,
NSPoint
是一个独立的结构,与CGPoint
不兼容根据 C 的说法,尽管它们实际上以相同的格式保存相同的值。“像 64 位一样构建 32 位”部分是一个您可以定义的宏,它使得该部分和其他一些内容的定义方式与 64 位构建中的相同。该宏的名称是
NS_BUILD_32_LIKE_64
;将其定义为1
打开该功能。我推荐它。I had been compiling for the default "Standard (32/64-bit Intel)" Architecture changing this to "64-bit Intel" resolved the problem.
I could resolve the problem by including explicit conversions between NSPoint and CGPoint, although this is clumsy (and unnecessary in 64-bit).是的。这是另外两个解决方案。
I tried to discover what "Standard (32/64-bit Intel)" Architecture actually means, but drew a blank. The only thing I could find was this:-
A list of the architectures for which the product will be built. This is usually set to a predefined build setting provided by the platform. If more than one architecture is specified, a universal binary will be produced.
这是架构 (
ARCHS
) 设置的一般定义,而不是特定值。Poking around in Application Packages did not seem to show much difference between Standard (32/64-bit Intel) and 64-bit Intel.
Can anyone shed any light on this, and is there any point in trying to produce "Standard (32/64-bit Intel)" in an Application targeting 10.6 or later?
64 位 Mac OS X 中发生了一些变化,包括:
- 该语言中出现了一些新功能,例如非脆弱实例变量。这使您可以在运行时添加实例变量,并且更有用的是,在实现文件中隐藏实例变量声明,而不是在 header 中公开它们。
- 几何结构的定义发生了变化。这就是你遇到的情况。您现在可以自由地传递
NSPoint
其中CGPoint
是预期的,反之亦然,对于其他结构也是如此。- 类似地,许多以前获取或返回多个点作为
float
的方法现在将其作为CGFloat
获取或返回,可以定义为double
.NSUInteger
定义为unsigned long
,不是unsigned int
,对于NSInteger
也是如此。 .其中一些内容与 32 位 OS X 完全不兼容,例如语言更改;您可以编写一个无法为 32 位构建的程序。
其他破损情况较软。如上所述,一些定义在 64 位中发生了更改,但为了兼容性,较旧的定义仍然是 32 位中的默认定义,但您可以使用上述宏来切换它们。
那么为什么这很重要?
2006 年底/2007 年初之前推出的 Mac 型号仅支持 32 位 Intel 架构(IA32,又名 i386)。大约 2007 年初,Apple 开始推出也支持 64 位架构 (x86-64) 的 Mac。
在 64 位硬件上运行的 Mac OS X(到目前为止)始终可以运行 32 位软件,但在 32 位硬件上运行的 Mac OS X 只能运行 32 位软件。 Mac OS X 本身是为两者而构建的,直到 Lion;现在,它需要 64 位 Mac。
因此,构建 32 位的唯一原因是您希望支持五年前的硬件(例如,如果您拥有该硬件)。如果您希望获得较新的语言功能并且不介意放弃拥有五年前 Mac 的客户,那么就只使用 64 位,不要回头。
当然,这是假设您没有任何手写的 i386 汇编代码或使用 Carbon 中不再支持的函数的代码。如果您这样做,那么这就是坚持使用 32 位的另一个潜在动机。请注意,Mac OS X 中对 32 位程序的支持有一天可能会消失。
苹果有相关文档:
关于cocoa - "Standard (32/64-bit Intel)"Architecture 作为目标实际上意味着什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8371926/
如果您设计分布式应用程序以实现轻松扩展,或者您只想使用 Amazon、Google 或 Microsoft 提供的任何新的“云计算”产品,那么您通常最终会使用一些典型的概念或组件: 分布式 blob
根据uncle Bob's Clean Architecture 、企业和应用程序业务规则(概念上由命令组成)位于外部接口(interface)层之下的层中。因此,无论何时调用接口(interface
我在网上找不到它的任何实现实际上为您提供了一种与框架无关且实用的实现方式。 我已经看到了几个解决它的低于标准的建议: 使存储库方法成为原子 使用例原子化 它们都不是理想的。 案例#1 :大多数用例依赖
我正在查看 Sparkle 项目的配置并注意到它们设置: 架构 = ppc i386 x86_64 有效架构 = i386 x86_64 来自苹果的有效架构描述: Space-separated li
只听本周的podcast并认为将您的一些经验组合在一起会很好,在这些经验中,您已经看到设计的“架构”方面比应有的支配更多东西。 Java 在这方面经常受到负面报道,而且随着 Java EE 的复杂性增
我正在阅读 Bob Martin (https://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html) 的清洁架构
OSGi是模块化架构,JavaBeans是组件架构。有什么区别? 最佳答案 OSGi 和 Java Beans 之间的主要区别在于类加载器的工作方式。在标准 .jar 文件或 EJB 中,rt.jar
我对 Clean Architecture 中的 Gateway to Entity 依赖有疑问。我认为以下同心圆图形经常被介绍为整洁的架构。 在上图中,Gateway并没有直视Entity。但是,还
我试图理解 TOGAF 9 的核心概念。 无论我多长时间阅读 TOGAF 手册中的解释,我都无法理解 Enterprise Continuum 和 Architecture Repository 之间
如果 Kappa 架构直接对流进行分析,而不是将数据拆分为两个流,那么在像 Kafka 这样的消息系统中,数据存储在哪里?或者它可以在数据库中进行重新计算? 单独的批处理层是否比使用流处理引擎重新计算
它们的含义是什么,我可以将它们设置为不同的值吗? 最佳答案 架构是您想要构建的架构,有效的架构是您可以设想使用您的代码库构建的架构。 所以也许您只想为 armv7 构建二进制文件,但相同的源代码可以为
我现在正在尝试在 Xcode 4.0 中构建的项目遇到问题,希望有人可以为我解释一下。 我正在尝试使用 ZBar SDK 并遵循此处概述的指南中概述的说明: http://zbar.sourcefor
在基于 Apple Silicon 的机器上使用 Interface builder 时,我当前的项目会引发 IBDesignable 错误。 我尝试排除用于调试的 arm64 架构,以及我在互联网上
Xcode 项目中出现警告: crypto was rejected as an implicit dependency for 'libcrypto.a' because its architect
我正在 Xcode 5 中开始新项目。我想使用 iOS SDK 7 开发应用程序,但部署目标为 iOS 5.0。当我在 Xcode 中创建新项目并尝试将部署目标更改为 5.0 时,我收到了这条消息:
编辑 :这个问题可能是旧的,它与 xcode 3 有关。 我正在开发一个需要 voip 支持的 iPhone 应用程序,所以我添加了 pjsip 的 ARM 版本图书馆。但如果我使用 iPhone 模
我们最近将最低 iOS 支持设置为 4.0,并开始使用 LLVM 编译器对当前可用的应用程序进行新更新。 将“架构”和“有效架构”设置为仅 armv7 是否会排除 iPhone 3G 等 armv6
我想在我的 64 位机器上启用额外的架构(32 位)。我做了 dpkg --print-architecture 来了解已知的架构,即 amd64 。之后我做了 dpkg --print--forei
操作系统:OS X Yosemite 版本 10.10.1 XCode:未安装 应用程序加载器3.0 (620) PhoneGap:3.7.0 PhoneGap 构建:在线 (build.phoneg
我们已经构建了一个具有多个 native 绑定(bind)的 Xamarin 应用程序(iOS、Android)。该应用程序在设备和模拟器上运行良好,我们能够毫无问题地构建存档(显然)。 问题是当我们
我是一名优秀的程序员,十分优秀!