我正在構建一個需要在多個版本的iPhone OS上工作的應用程序,並利用iOS4中的核心位置提高了準確性。不斷變化的iPhone部署目標:處理框架常量
我有代碼,執行以下操作: if ([m_locationManager respondsToSelector:@selector(startMonitoringSignificantLocationChanges)]) { m_locationManager.desiredAccuracy = kCLLocationAccuracyBestForNavigation; } else { m_locationManager.desiredAccuracy = kCLLocationAccuracyBest; }
,kCLLocationAccuracyBestForNavigation是在IOS 4中引入的常數,startMonitoringSignificantLocationChanges僅在iOS4的引入m_locationManager的方法。
我的問題是,此代碼在iPhone 3.1.3設備上失敗。它試圖鏈接到kCLLocationAccuracyBestForNavigation,但它找不到符號。我的問題是,我怎樣才能鏈接到iOS4版本的這個符號,但不是iPhone 3.1.3版本?
感謝, Ç