當我嘗試使用UITapGestureRecognizer時,我的iOS模擬器崩潰。iOS模擬器上的UITapGestureRecognizer崩潰
這是我的手勢:
UITapGestureRecognizer tap = new UITapGestureRecognizer (new NSAction(delegate {
if(SettingsTapped != null){
SettingsTapped(this, EventArgs.Empty);
}
}));
我加入這個手勢一個UIView,然後添加該視圖一個UITableViewCell。 觸摸視圖(每次)後該應用程序崩潰,顯示沒有例外。
她是從模擬器的日誌文件輸出:
Nov 4 10:49:47 administorsmini xXxXx[11073]: assertion failed: 13E28 12B411: libsystem_sim_trace.dylib + 19982 [BEE53863-0DEC-33B1-BFFB-8F7AE595CC73]: 0x4
Nov 4 10:49:49 administorsmini xXxXx[11073]: Stacktrace:
Nov 4 10:49:49 administorsmini xXxXx[11073]: at <unknown> <0xffffffff>
Nov 4 10:49:49 administorsmini xXxXx[11073]: at (wrapper managed-to-native) MonoTouch.UIKit.UIApplication.UIApplicationMain (int,string[],intptr,intptr) <IL 0x000a6, 0xffffffff>
Nov 4 10:49:49 administorsmini xXxXx[11073]: at MonoTouch.UIKit.UIApplication.Main (string[],intptr,intptr) [0x00005] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:62
Nov 4 10:49:49 administorsmini xXxXx[11073]: at MonoTouch.UIKit.UIApplication.Main (string[],string,string) [0x00038] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:46
Nov 4 10:49:49 administorsmini xXxXx[11073]: at xXxXx.Application.Main (string[]) [0x00008] in /Users/Norman/Desktop/xXxXx/xXxXx/Main.cs:17
Nov 4 10:49:49 administorsmini xXxXx[11073]: at (wrapper runtime-invoke) <Module>.runtime_invoke_void_object (object,intptr,intptr,intptr) <IL 0x00050, 0xffffffff>
Nov 4 10:49:49 administorsmini xXxXx[11073]:
Native stacktrace:
Nov 4 10:49:49 administorsmini xXxXx[11073]:
=================================================================
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Nov 4 10:49:49 administorsmini com.apple.CoreSimulator.SimDevice.27B5D497-B641-4BCA-8FA0-EF9E28E07143.launchd_sim[10951] (UIKitApplication:com.your-company.xXxXx[0x7041][11073]): Service exited due to signal: Abort trap: 6
Nov 4 10:49:49 administorsmini SpringBoard[10962]: Application 'UIKitApplication:com.your-company.xXxXx[0x7041]' crashed.
Nov 4 10:49:49 administorsmini assertiond[10966]: notify_suspend_pid() failed with error 7
Nov 4 10:49:49 administorsmini assertiond[10966]: assertion failed: 13E28 12B411: assertiond + 11523 [3F572A0B-7E12-378D-AFEE-EA491BAF2C36]: 0x1
我現在該怎麼辦? 我不想要開發的設備...
編輯
我最終通過重寫的UIView,並使用其TouchesBegan()
方法。 有許多方法可以使點擊的東西,但我爲什麼不能只使用這個上面?
您是否試圖添加用選擇器作爲參數的構造函數創建的tapgesture? – user3455363 2014-11-04 10:37:30
是的,我嘗試過,但不幸的是不能解決我的問題,因爲我需要在創建手勢的同一上下文中使用代理的手勢。 – 2014-11-04 12:15:24