首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用performSelector

使用performSelector
EN

Stack Overflow用户
提问于 2010-04-30 23:51:15
回答 3查看 1.8K关注 0票数 0

我有一个实现reverseGeocoder的方法

代码语言:javascript
复制
- (void)reversing { 
 geoCoder=[[MKReverseGeocoder alloc] initWithCoordinate:locManager.location.coordinate];
 geoCoder.delegate=self;
 [geoCoder start]; 
}

我记得在另一种方法中使用了以下内容:

代码语言:javascript
复制
[self performSelector:@selector(reversing) withObject:nil afterDelay:10];

我收到了

代码语言:javascript
复制
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”.

有人能帮帮我吗?

EN

回答 3

Stack Overflow用户

回答已采纳

发布于 2010-05-01 00:21:57

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

票数 1
EN

Stack Overflow用户

发布于 2013-11-09 08:52:41

My answer to a similar question:

我最近遇到并解决了这个问题。在我的例子中,当Apple Map无法找到查询的任何结果时,它有时会抛出这个"MKErrorDomain = 4“错误。因此,我最终只是将其视为“未找到结果”。

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

票数 1
EN

Stack Overflow用户

发布于 2010-05-01 00:45:46

嗯,现在performSelector已经为mhmm工作了10-12次,退出后

代码语言:javascript
复制
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
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/2745806

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档