- iOS/Objective-C 元类和类别
- objective-c - -1001 错误,当 NSURLSession 通过 httpproxy 和/etc/hosts
- java - 使用网络类获取 url 地址
- ios - 推送通知中不播放声音
我正在使用 Xamarin Forms,我只在第一代 iPad Mini (iOS 9.3.3 (13G34)) 上看到这个问题。
该应用程序启动正常,点击内容正常。唯一的问题发生在我“点击并按住”按钮时,导致它崩溃。
错误消息的重要部分可能是这样的:
+[NSTimer scheduledTimerWithTimeInterval:repeats:block:]: unrecognized selector sent to class 0x3b101ed4
未处理的异常:Foundation.MonoTouchException:
现在这个 [SO answer][1] 指出 NSTimer 是一个 iOS10+ API,因此 iOS9 不被支持。
我的问题是如何在 Xamarin Forms 环境中修复它?
谢谢。
完整的错误消息文本:
2018-10-18 14:31:25.805 MyApp.iOS[319:59406] +[NSTimer scheduledTimerWithTimeInterval:repeats:block:]: unrecognized selector sent to class 0x3b101ed4
Unhandled Exception:
Foundation.MonoTouchException: <Timeout exceeded getting exception details>
Thread finished: <Thread Pool> #10
The thread 0xa has exited with code 0 (0x0).
Thread finished: <Thread Pool> #13
The thread 0xd has exited with code 0 (0x0).
2018-10-18 14:31:47.340 MyApp.iOS[319:59406]
Unhandled Exception:
0 MyApp.iOS 0x05941e01 setup_stack_trace + 128
1 MyApp.iOS 0x0594017f mono_handle_exception_internal + 2026
2 MyApp.iOS 0x0593f991 mono_handle_exception + 50
3 MyApp.iOS 0x05937837 mono_arm_throw_exception + 118
4 MyApp.iOS 0x0085ac4c throw_exception + 64
5 MyApp.iOS 0x05a88390 xamarin_process_managed_exception_gchandle + 60
6 MyApp.iOS 0x05a8834c xamarin_ftnptr_exception_handler + 24
at (wrapper native-to-managed) ObjCRuntime.Runtime.throw_ns_exception (intptr) [0x00025] in <572357c3f84340a29e439dbdac7629bd#91B547D7-180F-9262-A1A8-072C01C70687>:0
8 MyApp.iOS 0x05a86228 xamarin_throw_ns_exception + 52
9 MyApp.iOS 0x05a892b4 _ZL17exception_handlerP11NSException + 288
10 CoreFoundation
0x24157c57 <redacted> + 642
11 libobjc.A.dylib 0x238f309f <redacted> + 174
12 libc++abi.dylib 0x238e4e17 <redacted> + 78
13 libc++abi.dylib 0x238e48f9 __cxa_increment_exception_refcount + 0
14 libobjc.A.dylib 0x238f2f5f objc_exception_rethrow + 42
15 CoreFoundation 0x240672af CFRunLoopRunSpecific + 654
16 CoreFoundation 0x24067015 CFRunLoopRunInMode + 108
17 GraphicsServices 0x25657ac9 GSEventRunModal + 160
18 UIKit 0x2873b189 UIApplicationMain + 144
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) [0x0004f] in <572357c3f84340a29e439dbdac7629bd#91B547D7-180F-9262-A1A8-072C01C70687>:0
at UIKit.UIApplication.Main (string[],intptr,intptr) [0x00011] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:80
at UIKit.UIApplication
.Main (string[],string,string) [0x00034] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:64
at MyApp.iOS.Application.Main (string[]) [0x00001] in C:\Projects\MyProject\MyApp\MyApp.iOS\Main.cs:17
at (wrapper runtime-invoke) object.runtime_invoke_dynamic (intptr,intptr,intptr,intptr) [0x0001e] in <7d5a05cfcb09432d8cc656b9d781e54b#91B547D7-180F-9262-A1A8-072C01C70687>:0
24 MyApp.iOS 0x0594c9c9 mono_jit_runtime_invoke + 824
25 MyApp.iOS 0x059b6eef mono_runtime_invoke_checked + 102
26 MyApp.iOS 0x059bb6db mono_runtime_exec_main_checked + 66
27 MyApp.iOS 0x05934141 mono_jit_exec + 198
28 MyApp.iOS 0x05a9d174 xamarin_main + 2452
29 MyApp.iOS 0x002388bd main + 102
30 libdyld.dylib 0x23d0f873 <redacted> + 2
2018-10-18 14:31:47.344 MyApp.iOS[319:59406] Unhandled managed exception:
Objective-C exception thrown. Name: NSInvalidArgumentException Reason: +[NSTimer scheduledTimerWithTimeInterval:repeats:block:]: unrecognized selector sent to class 0x3b101ed4
Native stack trace:
0 CoreFoundation 0x24157933 <redacted> + 150
1 libobjc.A.dylib 0x238f2e17 objc_exception_throw + 38
2 CoreFoundation 0x2415d1d1 <redacted> + 0
3 CoreFoundation 0x2415aee1 <redacted> + 700
4 CoreFoundation 0x24086238 _CF_forwarding_prep_0 + 24
5 MyApp.iOS 0x02ae4e68 wrapper_managed_to_native_ObjCRuntime_Messaging_IntPtr_objc_msgSend_Double_bool_IntPtr_intptr_intptr_double_bool_intptr + 156
6 MyApp.iOS 0x025eb030 Foundation_NSTimer_CreateScheduledTimer_double_bool_System_Action_1_Foundation_NSTimer + 276
7 MyApp.iOS 0x058b39ec MyApp_Forms
_Controls_ExtendedButtonRenderer_OnLongPressed_UIKit_UILongPressGestureRecognizer + 1468
8 MyApp.iOS 0x0286d720 UIKit_UILongPressGestureRecognizer_Callback_Activated_UIKit_UILongPressGestureRecognizer + 52
9 MyApp.iOS 0x008014a4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 232
10 MyApp.iOS 0x0594c9c9 mono_jit_runtime_invoke + 824
11 MyApp.iOS 0x059b6eef mono_runtime_invoke_checked + 102
12 MyApp.iOS 0x059b9ac1 mono_runtime_invoke + 56
13 MyApp.iOS 0x001e7119 _ZL32native_to_managed_trampoline_212P11objc_objectP13objc_selectorPP11_MonoMethodP28UILongPressGestureRecognizerj + 326
14 MyApp.iOS 0x001e6fcf -[__UILongPressGestureRecognizer target:] + 50
15 UIKit 0x28c389eb <redacted> + 142
16 UIKit 0x2887384f <redacted> +
170
17 UIKit 0x28704ff1 <redacted> + 1004
18 UIKit 0x28c39d4f <redacted> + 62
19 UIKit 0x286c5a57 <redacted> + 298
20 UIKit 0x286c2017 <redacted> + 2902
21 CoreFoundation 0x241196c9 <redacted> + 20
22 CoreFoundation 0x241179cd <redacted> + 280
23 CoreFoundation 0x24117dff <redacted> + 958
24 CoreFoundation 0x24067229 CFRunLoopRunSpecific + 520
25 CoreFoundation 0x24067015 CFRunLoopRunInMode + 108
26 GraphicsServices 0x25657ac9 GSEventRunModal + 160
27 UIKit 0x2873b189 UIApplicationMain + 144
28 MyApp.iOS 0x02bc227c wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 288
29 MyApp.iOS 0x02412044 UIKit_UIApplication_Main_stri
ng___intptr_intptr + 52
30 MyApp.iOS 0x02411edc UIKit_UIApplication_Main_string___string_string + 200
31 MyApp.iOS 0x0023acb0 MyApp_iOS_Application_Main_string__ + 152
32 MyApp.iOS 0x008014a4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 232
33 MyApp.iOS 0x0594c9c9 mono_jit_runtime_invoke + 824
34 MyApp.iOS 0x059b6eef mono_runtime_invoke_checked + 102
35 MyApp.iOS 0x059bb6db mono_runtime_exec_main_checked + 66
36 MyApp.iOS 0x05934141 mono_jit_exec + 198
37 MyApp.iOS 0x05a9d174 xamarin_main + 2452
38 MyApp.iOS 0x002388bd main + 102
39 libdyld.dylib 0x23d0f873 <redacted> + 2
(Foundation.MonoTouchException)
at ObjCRuntime.Runtime.ThrowNSException (System.IntPtr ns_exception) [0x00000] in /Library/F
rameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/ObjCRuntime/Runtime.cs:398
at ObjCRuntime.Runtime.throw_ns_exception (System.IntPtr exc) [0x00000] in /Users/builder/jenkins/workspace/xamarin-macios/xamarin-macios/runtime/Delegates.generated.cs:126
at (wrapper native-to-managed) ObjCRuntime.Runtime.throw_ns_exception(intptr)
--- End of stack trace from previous location where exception was thrown ---
at (wrapper managed-to-native) UIKit.UIApplication.UIApplicationMain(int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, System.IntPtr principal, System.IntPtr delegate) [0x00005] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:79
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x0002c] in /Library/Frameworks/Xamarin.iOS.framework/Versions/12.0.0.15/src/Xamarin.iOS/UIKit/UIApplication.cs:63
at MyApp.iOS.Application.Main (Syst
em.String[] args) [0x00001] in C:\Projects\MyProjects\MyApp\MyApp.iOS\Main.cs:17
2018-10-18 14:31:47.346 MyApp.iOS[319:59406] critical: Stacktrace:
2018-10-18 14:31:47.346 MyApp.iOS[319:59406] critical:
Native stacktrace:
2018-10-18 14:31:50.337 MyApp.iOS[319:59406] critical: 0 MyApp.iOS 0x05940dfd mono_handle_native_crash + 196
2018-10-18 14:31:50.338 MyApp.iOS[319:59406] critical: 1 libsystem_platform.dylib 0x23e86077 _sigtramp + 42
2018-10-18 14:31:50.338 MyApp.iOS[319:59406] critical: 2 libsystem_pthread.dylib 0x23e8c733 pthread_kill + 62
2018-10-18 14:31:50.339 MyApp.iOS[319:59406] critical: 3 libsystem_c.dylib 0x23d770ad abort + 108
2018-10-18 14:31:50.339 MyApp.iOS[319:59406] critical: 4 MyApp.iOS 0x05a888b4 xamarin_printf + 0
2018-10-18 14:31:50.339 MyApp.iOS[319:59406] critical: 5 MyApp.iOS 0x0597bf1f mono_invoke_unhandled_exception_hook + 102
2018-10-18 14:31:50.340 MyApp.iOS[319:59406] critical: 6 MyApp.iOS 0x0594083b mono_handle_exception_internal + 3750
2018-10-18 14:31:50.340 MyApp.iOS[319:59406] critical: 7 MyApp.iOS 0x0593f991 mono_handle_exception + 50
2018-10-18 14:31:50.341 MyApp.iOS[319:59406] critical: 8 MyApp.iOS 0x05937837 mono_arm_throw_exception + 118
2018-10-18 14:31:50.341 MyApp.iOS[319:59406] critical: 9 MyApp.iOS 0x0085ac4c throw_exception + 64
2018-10-18 14:31:50.341 MyApp.iOS[319:59406] critical: 10 MyApp.iOS 0x05a88390 xamarin_process_managed_exception_gchandle + 60
2018-10-18 14:31:50.342 MyApp.iOS[319:59406] critical: 11 MyApp.iOS 0x05a8834c xamarin_ftnptr_exception_handler + 24
2018-10-18 14:31:50.342 MyApp.iOS[319:59406] critical: 12 MyApp.iOS 0x02bd4f14 wrapper_native_to_managed_ObjCRuntime_Runtime_throw_ns_exception_intptr + 372
2018-10-18 14:31:50.342 MyApp.iOS[319:59406] critical: 13 MyApp.iOS 0x05a86228 xamarin_throw_ns_exception + 52
2018-10-18 14:31:50.343 MyApp.iOS[319:59406] critical: 14 MyApp.iOS 0x05a892b4 _ZL17exception_handlerP11NSException + 288
2018-10-18 14:31:50.344 MyApp.iOS[319:59406] critical: 15 CoreFoundation 0x24157c57 <redacted> + 642
2018-10-18 14:31:50.344 MyApp.iOS[319:59406] critical: 16 libobjc.A.dylib 0x238f309f <redacted> + 174
2018-10-18 14:31:50.344 MyApp.iOS[319:59406] critical: 17 libc++abi.dylib 0x238e4e17 <redacted> + 78
2018-10-18 14:31:50.345 MyApp.iOS[319:59406] critical: 18 libc++abi.dylib 0x238e48f9 __cxa_increment_exception_refcount + 0
2018-10-18 14:31:50.345 MyApp.iOS[319:59406] critical: 19 libobjc.A.dylib 0x238f2f5f objc_exception_rethrow + 42
2018-10-18 14:31:50.345 MyApp.iOS[319:59406] critical: 20 CoreFoundation 0x240672af CFRunLoopRunSpecific + 654
2018-10-18 14:31:50.346 MyApp.iOS[319:59406] critical: 21 CoreFoundation 0x24067015 CFRunLoopRunInMode + 108
2018-10-18 14:31:50.346 MyApp.iOS[319:59406] critical: 22 GraphicsServices 0x25657ac9 GSEventRunModal + 160
2018-10-18 14:31:50.347 MyApp.iOS[319:59406] critical: 23 UIKit 0x2873b189 UIApplicationMain + 144
2018-10-18 14:31:50.347 MyApp.iOS[319:59406] critical: 24 MyApp.iOS 0x02bc227c wrapper_managed_to_native_UIKit_UIApplication_UIApplicationMain_int_string___intptr_intptr + 288
2018-10-18 14:31:50.348 MyApp.iOS[319:59406] critical: 25 MyApp.iOS 0x02412044 UIKit_UIApplication_Main_string___intptr_intptr + 52
2018-10-18 14:31:50.348 MyApp.iOS[319:59406] critical: 26 MyApp.iOS 0x02411edc UIKit_UIApplication_Main_string___string_string + 200
2018-10-18 14:31:50.349 MyApp.iOS[319:59406] critical: 27 MyApp.iOS 0x0023acb0 MyApp_iOS_Application_Main_string__ + 152
2018-10-18 14:31:50.350 MyApp.iOS[319:59406] critical: 28 MyApp.iOS 0x008014a4 wrapper_runtime_invoke_object_runtime_invoke_dynamic_intptr_intptr_intptr_intptr + 232
2018-10-18 14:31:50.351 MyApp.iOS[319:59406] critical: 29 MyApp.iOS 0x0594c9c9 mono_jit_runtime_invoke + 824
2018-10-18 14:31:50.351 MyApp.iOS[319:59406] critical: 30 MyApp.iOS 0x059b6eef mono_runtime_invoke_checked + 102
2018-10-18 14:31:50.352 MyApp.iOS[319:59406] critical: 31 MyApp.iOS 0x059bb6db mono_runtime_exec_main_checked + 66
2018-10-18 14:31:50.352 MyApp.iOS[319:59406] critical: 32 MyApp.iOS 0x05934141 mono_jit_exec + 198
2018-10-18 14:31:50.352 MyApp.iOS[319:59406] critical: 33 MyApp.iOS 0x05a9d174 xamarin_main + 2452
2018-10-18 14:31:50.353 MyApp.iOS[319:59406] critical: 34 MyApp.iOS 0x002388bd main + 102
2018-10-18 14:31:50.353 MyApp.iOS[319:59406] critical: 35 libdyld.dylib 0x23d0f873 <redacted> + 2
2018-10-18 14:31:50.354 MyApp.iOS[319:59406] critical:
=================================================================
Got a SIGABRT while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
The app has been terminated.
Failed to Stop app: An error occured on client IDB4110776 while executing a reply for topic xvs/idb/4.11.0.776/stop-app
The app has been terminated.
[1]: https://stackoverflow.com/questions/40521799/trivial-nstimer-scheduledtimerwithtimeintervalrepeatsblock-unrecognized
最佳答案
可以使用方法
public static NSTimer CreateScheduledTimer (double seconds, NSObject target, Selector selector, NSObject userInfo, bool repeats)
For Example
//...
using ObjCRuntime;
//...
NSTimer.CreateScheduledTimer(0.5, this, new Selector("DelayAction"), null, false);
[Export("DelayAction")]
public void DelayAction()
{
// do some thing you want
}
关于ios - 未处理的异常 : Foundation. MonoTouchException:<超时获取异常详细信息>发生,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52883087/
03-25 05:52:15.329 8029-8042/com.mgh.radio W/MediaPlayerNative: info/warning (703, 0) 03-25 05:52:15
我一直在 Internet 上到处寻找关于 FrameworkElementFactory 类的适当文档,但我似乎找不到有关它的适当教程或有用信息。 请问对这个问题了解更多的人可以给我更多的信息吗?这
我需要知道一个线程在进入等待状态之前如何将其ID发送到另一个线程。我想传递一个带有其ID的变量,但我不知道该怎么做。 最佳答案 如果只有一个线程及其父线程,则可以使用全局变量,因为它们在所有线程之间共
我正在尝试制作一个程序,该程序可以读取命令行上的所有单词,然后将其打印在新行上,而我想要做的是这样的: Some text: hello 但是相反,我得到了这样的东西: Some text: Hell
我有一个连接到rabbitmq服务器的python程序。当该程序启动时,它连接良好。但是当rabbitmq服务器重新启动时,我的程序无法重新连接到它,并留下错误“Socket已关闭”(由kombu产生
我正在设置CI / CD管道。部署步骤运行以下命令: kubectl apply -f manifest.yml --namespace kubectl rollout status Deploym
关闭。这个问题需要多问focused 。目前不接受答案。 想要改进此问题吗?更新问题,使其仅关注一个问题 editing this post . 已关闭 4 年前。 Improve this ques
这是我在文件上运行 svn info 时输出的一部分: Last Changed Author: [user] Last Changed Rev: 269612 Last Changed Date:
所以我正在构建这个音乐应用程序,到目前为止它只扫描 SD 卡内的特定文件夹。这将返回路径,然后播放它们。 几个小时前我得知android系统中有一个媒体文件数据库所以 我想知道这个媒体文件数据库是否存
我正在绘制树形图,并且想知道如何绘制树类的相对百分比,即 A组=100 B地=30 C地=50 D 地 =20 然后,在图中,应该添加: A 组“50%” B 组“15%” 等在其“Group X”标
我正在构建一个社交网站,我想知道如何在用户首次登录时显示交互式教程和信息。比如只有在第一次登录时,用户才会被要求在他们的个人资料中填写更多信息。我怎样才能通过 php 和 mysql 实现这一点?例子
我是 java servlet 的新手。我研究了一些关于 servlet 的代码,但我真的很想知道更多基本的东西以及它是如何工作的。我只是想知道什么类型的 Material /内容可以从 java s
我想知道是否有办法为 user_id、sender_user_id 和 recipient_user_id 提供 name 信息来自 this fiddle 中的模式. 我现在唯一能想到的办法就是做这
这是我存储2个大学生信息的源代码。我想从输入中获取每个人的姓名、姓氏、ID 和 5 分,然后在输出中显示它们。我在输出中显示分数时遇到问题。 请帮忙 #include using namespace
假设我有一张带有条形图的图像,如下所示: 我想提取条形图和标签的值,除了训练 ML 模型之外,还有其他方法吗? 我有一堆图像,我为其生成了图表和一些描述。我目前正尝试仅从我能够做到的描述中提取信息,但
有没有办法从 GKTurnBasedParticipant 对象中检索玩家的名字?似乎除了根据类引用的难看的 playerID 之外,没有办法显示有关游戏玩家的相关信息。还是我遗漏了什么? 谢谢...
我有一个随机抛出“KeyNotFoundException”的 C# Silverlight 应用程序。我不知道找不到什么 key 。这让我想到了两个问题: KeyNotFoundException
本文实例为大家分享了ios获取本地音频文件的具体代码,供大家参考,具体内容如下 获取本地音频文件地址: ?
下面为大家介绍利用SQL查询语句获取Mysql数据库中表的表名,表描述、字段ID、字段名、数据类型、长度、精度、是否可以为null、默认值、是否自增、是否是主键、列描述 1、查询表信息(表名/表
问题 有没有办法获取代码中使用属性的位置,或声明成员变量的位置? 我不是在寻找解决此问题的方法,只是寻求一个简单的答案,无论这在技术上是否可行。 一些背景信息 我已经定义了一个属性,该属性使用提供给属
我是一名优秀的程序员,十分优秀!