0

我有实现 reverseGeocoder 的方法

- (void)reversing { 
 geoCoder=[[MKReverseGeocoder alloc] initWithCoordinate:locManager.location.coordinate];
 geoCoder.delegate=self;
 [geoCoder start]; 
}

我记得用另一种方法倒车:

[self performSelector:@selector(reversing) withObject:nil afterDelay:10];

我收到

2010-04-30 17:44:17.616 high[1167:207] Retrive City Milano
2010-04-30 17:44:17.628 high[1167:207] geocoder released
2010-04-30 17:44:18.723 high[1167:207] Error Domain=MKErrorDomain Code=4 "Operation     
could not be completed. (MKErrorDomain error 4.)"
Program received signal:  “EXC_BAD_ACCESS”.

有人能帮我吗?:D

4

3 回答 3

1

看起来您正在释放地理编码器或其委托,这会导致 BAD_ACCESS。很有可能您已经在错误处理程序中释放了它,或者在释放调用对象时可能通过 dealloc 释放它。

于 2010-04-30T16:21:56.640 回答
1

我对类似问题的回答:

我最近遇到并解决了这个问题。就我而言,当 Apple Map 找不到任何查询结果时,它有时会抛出这个“MKErrorDomain = 4”错误。所以我最终只是将其视为“未找到结果”。

发现这一点很费劲,MapKit 需要一个更好的错误处理系统。

于 2013-11-09T00:52:41.383 回答
0

mhmmm 现在 performSelector 可以工作 mhmm 10-12 次,然后退出

Fri Apr 30 18:39:15 unknown high[1533] <Warning>: Retrive City Milano
Fri Apr 30 18:39:15 unknown high[1533] <Warning>: geocoder released
Fri Apr 30 18:39:21 unknown high[1533] <Error>: *** -[MKReverseGeocoder     _mapkit_cache_heapTime]: unrecognized selector sent to instance 0x181ab0
Fri Apr 30 18:39:21 unknown high[1533] <Error>: *** Terminating app due to uncaught     exception 'NSInvalidArgumentException', reason: '*** -[MKReverseGeocoder     _mapkit_cache_heapTime]: unrecognized selector sent to instance 0x181ab0'
Fri Apr 30 18:39:21 unknown high[1533] <Error>: Stack: (
853417245,
845594132,
853421053,
852917017,
852879424,
852520544,
853224229,
852521740,
852695624,
852661532,
834346012,
834339464,
871973071,
871972849,
837931029,
837876319,
837876577,
837875951,
837875865,
837875737,
837875641,
853164967,
853163039,
834376564,
817839152,
817832496,
10921,
10816
)
Fri Apr 30 18:39:21 unknown UIKitApplication:com.zeronet.TestTest[0xc5d1][1533] <Notice>: terminate called after throwing an instance of 'NSException'
Fri Apr 30 18:39:23 unknown ReportCrash[1536] <Notice>: Formulating crash report for process high[1533]
Fri Apr 30 18:39:23 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.zeronet.TestTest[0xc5d1]) Job appears to have crashed: Abort trap
Fri Apr 30 18:39:23 unknown SpringBoard[29] <Warning>: Application 'high' exited abnormally with signal 6: Abort trap
Fri Apr 30 18:39:24 unknown ReportCrash[1536] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/high_2010-04-30-183921_zeroPhone.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
于 2010-04-30T16:45:45.877 回答