*** 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[MKUserLocation commentType]:无法识别的选择器

发布于 2024-10-05 00:48:25 字数 202 浏览 0 评论 0原文

我在尝试添加用户位置时收到此错误。我有一个表格视图,当我尝试滚动时,我收到此错误。我对 xcode 很陌生。

* 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“-[MKUserLocation commentType]:无法识别的选择器发送到实例 0x803f090”

非常感谢任何帮助。

i am receiving this error when trying to add user location. I have a table view and when i try to scroll, i receive this error. I'm very new to xcode.

* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[MKUserLocation annotationType]: unrecognized selector sent to instance 0x803f090'

Any help is much appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

掩耳倾听 2024-10-12 00:48:25

MKUserLocation 没有annotationType 方法。您向 MKUserLocation 发送一条它不知道如何处理的消息。

MKUserLocation does not have an annotationType method. You're sending MKUserLocation a message that it does not know how to handle.

山人契 2024-10-12 00:48:25

我以前遇到过这种情况,通常是因为 simple &不明显的错误类型,即格式错误 - 没有根据意外的格式调用函数,类型错误。

我使用:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ABC:) ....name:@"UIDeviceBatteryLevelDidChangeNotification" object:nil];

“ABC”函数,我声明不是基于预期的函数格式。

我用的是

- (void) ABC:(NSNotification *)notification 

- (NSString *)DDD 

I am encountered this before, it is normally because of simple & not obvious type of mistake i.e format wrong - didn't call a function based on the unexpected format, type wrong.

I used:

[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ABC:) ....name:@"UIDeviceBatteryLevelDidChangeNotification" object:nil];

The "ABC" function, I declared not based on the expected function format.

Instead of:

- (void) ABC:(NSNotification *)notification 

I used:

- (NSString *)DDD 
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文