2011-11-30 83 views
3

如果此问题重复,请纠正我。当前位置仿真AppCode

我刚开始使用AppCode进行iOS编程。

我发现它非常有用,但问题开始发生。

我的应用程序是基于位置的应用程序,我需要模拟当前的位置,但与AppCode我似乎无法找到该选项。

我也试图选择iOS 5作为目标平台,但没有喜悦。

有没有人知道如何用这个IDE做到这一点?

+0

目前AppCode不支持位置模拟,请提交功能请求http://youtrack.jetbrains.net/issues/OC#newissue=yes。 –

回答

-2

在iPhone编程中获取位置非常简单。 步骤如下:

  1. 包括委托在appdelegate(或任何类)。
  2. 声明并初始化CLLocationManager对象 (i)。在.h中声明该对象。 CLLocationManager * locationManager; (ii).in .m文件初始化并向其中添加params。 locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation];

  3. 添加2个位置委托方法。

    • (无效)的LocationManager:(CLLocationManager )经理didUpdateToLocation:(CLLocation)newLocation fromLocation:(CLLocation *)oldLocation {
      如果(newLocation.coordinate.latitude & & newLocation.coordinate.longitude) // locationUpdateFlag = YES; NSString * latitudeStr = [[NSMutableString alloc] initWithFormat:@“%g”,newLocation.coordinate.latitude]; NSString * longitudeStr = [[NSMutableString alloc] initWithFormat:@“%lf”,newLocation.coordinate.longitude]; NSLog(@“lat ==%@,Long ==%@”,latitudeStr,longitudeStr); [locationManager stopUpdatingLocation];

      }

    • (无效)的LocationManager:(CLLocationManager *)经理didFailWithError:(NSError *)错误{ 的NSLog(@ “错误==%@”,错误);

      }

希望它有助于ü...

+0

我不认为你理解这个问题 – Bastian

+0

对不起,老兄,我已经知道如何使用Xcode,我遇到的问题与AppCode有关,它是Xcode –

+0

的替代品哦..我的坏...非常遗憾.... –

1

我相信是没有办法在AppCode模拟位置现在(当然,你只能在模拟器位置间切换本身)。你必须为此使用Xcode。

但是你可以选择iOS 5,这不是问题。要做到这一点,你将不得不编辑或创建新的“运行配置”。点击“运行”/“调试”按钮左侧的组合框。将会有“编辑配置”项目。您可以在此编辑SDK /调试器/配置以运行应用程序。

当然,您的iOS SDK与iOS 5.0将安装在您的系统中。我相信,它是Xcode 4.2及更高版本。