How to solve Xcode 4.1 (LION) GPS error?

匿名 (未验证) 提交于 2019-12-03 01:58:03

问题:

My project worked perfectly on simulator+device,
but now, after upgrading to lion os and xcode 4.1, I get this error when gps is active!

server did not accept client registration 68 

It's a gps based application, and i'm nervous to not debug app in simulator!

Any idea to solve this issue?


UPDATE: Gps on Simulator doesn't work also on Xcode 3.2.6 + LION.


EDIT: Apple response on bug tracker:

After further investigation it has been determined that this is a known issue, which is currently being investigated by engineering. This issue has been filed in our bug database under the original Bug ID#. Thank you for submitting this bug report. We truly appreciate your assistance in helping us discover and isolate bugs.

回答1:

Xcode 4.2 solved this problem adding custom gps position!

The file is an XML like this:

 Milano

you can add this file in your project or New->File->GPX.

While you're running your app, activate the console and select your custom position file:

it's all.
enjoy.



回答2:

From the Big Nerd Ranch forum:

@implementation CLLocationManager (TemporaryHack) - (void)hackLocationFix {     CLLocation *location = [[CLLocation alloc] initWithLatitude:42 longitude:-50];     [[self delegate] locationManager:self didUpdateToLocation:location fromLocation:nil];      } - (void)hackHeadingFix {     [[self delegate] locationManager:self didUpdateHeading:(id)@"That way.."]; } - (void)startUpdatingLocation {     [self performSelector:@selector(hackLocationFix) withObject:nil afterDelay:0.1]; } - (void)startUpdatingHeading {     [self performSelector:@selector(hackHeadingFix) withObject:nil afterDelay:0.1]; } @end 


回答3:

I encountered the same problem, and searching for a solution, I at least found a workaround: Testing CoreLocation on iPhone Simulator - It doesn't actually make it work, but in my case I just needed a dummy location anyway.

To make it work, just copy linked code into a header file and link that below your

#import 

Like this:

#import  #import "CoreLocation_Sim.h"  


回答4:

Please see http://pastebin.com/7hvFiXCg for a somewhat souped-up version of the BNR code. It includes CLHeading support, among other adjustments. Enjoy!



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!