使用 Quartz 和 Quartz 有什么区别? C 与 ObjectiveC 加载图像?
在资源编程指南中,它提供了两种加载图像资源的方法,使用 Quartz 和 Quartz 。 C 与 ObjectiveC 。 谁能告诉我有什么区别?两者在处理大量图像时的性能相同吗?
In the Resource Programming Guide it gives 2 methods to load image resources, using Quartz & C vs ObjectiveC .
Can anyone tell me what the difference is? Are both identical in terms of performance with a large number of images?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
首先,它在技术上是石英和石英。 C vs 可可& Objective-C。 Objective-C 只是一种语言——它与 Cocoa 框架没有内在的联系。
在底层,很多 Cocoa 只是 Quartz 和 CoreFoundation 的包装,所以你提到的两种方法在功能上应该是相同的。关于性能,我认为通过 Cocoa 加载图像资源会比直接通过 Quartz 加载图像资源稍慢,但这只是因为 Objective-C 消息发送等的轻微开销。不过,无论出于何种目的,这两种方法应该仅在编写代码的方式上有所不同(过程式 C 与面向对象的 Objective-C)。
First of all, it's technically Quartz & C vs Cocoa & Objective-C. Objective-C is just a language—it is not inherently tied to the Cocoa frameworks.
Under the hood, a lot of Cocoa is just a wrapper for Quartz and CoreFoundation, so the two methods you mentioned should be identical in terms of functionality. Regarding performance, I'd imagine loading image resources through Cocoa would be marginally slower than doing it directly through Quartz, but that's only because of the slight overhead of Objective-C message sending and whatnot. For all intents and purposes, though, the two methods should only differ in terms of how you write your code (procedural C vs. object-oriented Objective-C).