我有一個軟件硬件相關的問題,我試圖排除故障。我的應用程序是爲iPhone4,iOS5開發的,並使用Core Motion框架實時處理加速度計和陀螺儀數據。該應用程序失敗,iOS5的iOS5 CMMotionManager startDeviceMotionUpdatesToQueue:iPhone3GS上失敗
在iPhone 3GS上運行時,我的主要核心運動的方法是這樣的:
[motionManager startDeviceMotionUpdatesToQueue:motionQueue withHandler:^(CMDeviceMotion *motion, NSError *error) {
//notify calibration delegate
if(calibrationDelegate)
{
[calibrationDelegate collectCalibrationMotionData:motion];
}
//a lot more processing
}
我有報道稱,iPhone 3GS的不肯定返回isGyroAvailable,而iPhone4的返回YES。
BOOL accelerometerAvailable = (motionManager.isAccelerometerAvailable)?YES:NO;
BOOL gyroscopeAvailable = (motionManager.isGyroAvailable)?YES:NO;
if(!accelerometerAvailable && ! gyroscopeAvailable)
{
//handle error
remoteControlState = kRemoteControlStateError;
}
我痛苦地發現,蘋果公司銷售我的應用程序爲客戶提供的iPhone4,4S和3GS。該應用程序不適用於使用iPhone 3GS的客戶,因爲上述呼叫似乎沒有將運動對象傳遞給校準代理。
我沒有iPhone 3GS上測試應用程序,所以我有幾個問題:
是否有可能在Xcode項目性質 ,我想我的應用程序運行的任何位置指定只在iPhone4及以上?(或設備與陀螺儀提供?)
我在哪裏可以找到的iOS5怪癖像上面 一個更多的信息,更好地瞭解的iPhone3GS從iPhone4的有什麼不同?