Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/117.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 为什么pitchEnabled被视为私有API?_Ios_Ios7_Appstore Approval_Iphone Privateapi - Fatal编程技术网

Ios 为什么pitchEnabled被视为私有API?

Ios 为什么pitchEnabled被视为私有API?,ios,ios7,appstore-approval,iphone-privateapi,Ios,Ios7,Appstore Approval,Iphone Privateapi,Xcode无法验证我的应用,因为 此应用程序引用有效负载中的非公共选择器/…:pitchEnabled #ifdef __IPHONE_7_0 if ([mapView respondsToSelector:@selector(pitchEnabled)]) { mapView.pitchEnabled = NO; mapView.rotateEnabled = NO; } #endif 将selector(pitchEnabled)替换为NSSelectorFromStrin

Xcode无法验证我的应用,因为

此应用程序引用有效负载中的非公共选择器/…:pitchEnabled

#ifdef __IPHONE_7_0
if ([mapView respondsToSelector:@selector(pitchEnabled)]) {
    mapView.pitchEnabled = NO;
    mapView.rotateEnabled = NO;
}
#endif

selector(pitchEnabled)
替换为
NSSelectorFromString(@“pitchEnabled”)
解决了这个问题,但让我感觉不好,为什么
pitchEnabled
被视为私有API,以及避免这种情况的最佳方法是什么?

因为您是在检查方法而不是属性。getter方法是
isPitchEnabled
而不是
pitchEnabled

// Rotate and pitch are enabled by default on Mac OS X and on iOS 7.0 and later.
@property (nonatomic, getter=isRotateEnabled) BOOL rotateEnabled NS_AVAILABLE(10_9, 7_0);
@property (nonatomic, getter=isPitchEnabled) BOOL pitchEnabled NS_AVAILABLE(10_9, 7_0);

这是正确的想法,尽管Tuss试图使用setter而不是getter。@如果需要检查属性是否存在,这应该仍然有效。但您也可以检查
setPicthEnabled:
是否存在。