iPod: NS_NONATOMIC_IPHONEONLY 是什么意思?在 iPod Touch 上使用这样的属性安全吗?
在属性部分下的 CLLocation 类参考中,它表示坐标:
coordinate
The geographical coordinate information. (read-only)
@property(readonly, NS_NONATOMIC_IPHONEONLY) CLLocationCoordinate2D coordinate
Discussion
When running in the simulator, Core Location assigns a fixed set of coordinate values to this property. You must run your application on an iOS-based device to get real location values.
Special Considerations
In iOS, this property is declared as nonatomic. In Mac OS X, it is declared as atomic.
我只是好奇这意味着什么:@property(readonly, NS_NONATOMIC_IPHONEONLY).特别是 NS_NONATOMIC_IPHONEONLY
部分。在我看来,我可以通过 iPod touch 访问此内容。
我错过了什么吗?从 iPod touch 使用此功能安全吗?
Inside the CLLocation Class Reference
under the properties section this what it says for coordinate
:
coordinate
The geographical coordinate information. (read-only)
@property(readonly, NS_NONATOMIC_IPHONEONLY) CLLocationCoordinate2D coordinate
Discussion
When running in the simulator, Core Location assigns a fixed set of coordinate values to this property. You must run your application on an iOS-based device to get real location values.
Special Considerations
In iOS, this property is declared as nonatomic. In Mac OS X, it is declared as atomic.
I am just curious what this means: @property(readonly, NS_NONATOMIC_IPHONEONLY)
. Specifically the NS_NONATOMIC_IPHONEONLY
part. It seems to me that I can access this from an iPod touch.
Am I missing something? Is it safe to use this from an iPod touch?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
CoreLocation 在 Mac OS X 和 iOS(née iPhone OS)之间共享。
这里,
NS_NONATOMIC_IPHONEONLY
仅表示该属性在 iOS 上是非原子的,在 Mac OS X 上是原子的。这里的 iPhone 仅指 iOS,而不是 iPhone 与 iPod touch。它在 TargetConditionals.h 中定义如下。
CoreLocation is shared across both Mac OS X and iOS (née iPhone OS).
Here,
NS_NONATOMIC_IPHONEONLY
only means that the propriety is nonatomic on iOS and atomic on Mac OS X. The iPhone here is only referring to iOS, not iPhone vs iPod touch.It is defined in TargetConditionals.h as this.