2010-11-28 1 views
3

coordinatecoordinate에 대한 내용은 다음과 같습니다. coordinate :iPod : NS_NONATOMIC_IPHONEONLY은 무엇을 의미합니까? iPod Touch에서 이와 같은 속성을 사용하는 것이 안전합니까?

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에서 이것을 사용해도 안전합니까?

답변

5

CoreLocation은 Mac OS X 및 iOS (nee iPhone OS)에서 공유됩니다.

여기에서 NS_NONATOMIC_IPHONEONLY은 iOS와 Mac OS X에서 비 원자성이라는 의미입니다. 여기의 iPhone은 iPhone과 iPod touch가 아니라 iOS를 나타냅니다.

이것은 TargetConditionals.h에서 다음과 같이 정의됩니다.

// Marks APIs whose iPhone versions are nonatomic, that is cannot be set/get from multiple threads safely without additional synchronization 
#if !defined(NS_NONATOMIC_IPHONEONLY) 
    #if TARGET_OS_IPHONE 
    #define NS_NONATOMIC_IPHONEONLY nonatomic 
    #else 
    #define NS_NONATOMIC_IPHONEONLY 
    #endif 
#endif 
+0

감사합니다. – sixtyfootersdude