2011-11-04 27 views
2

我有一個tableview有自定義單元格和一個單元格包含uiimageview,uilabels。當我按住並移動uitableviewcell時,有時會碰到這個日誌。如何刪除這個崩潰。我沒有在我的應用程序中使用任何手勢識別器,也沒有使用任何點擊或觸摸檢測。我只使用tableview委託和數據源方法。 Thanx任何幫助!碰撞,而長按桌面

'-[CALayer _longPressGestureRecognized:]: unrecognized selector sent to instance 0x10d060' 
*** Call stack at first throw: 
(
    0 CoreFoundation      0x367cd64f __exceptionPreprocess + 114 
    1 libobjc.A.dylib      0x33a26c5d objc_exception_throw + 24 
    2 CoreFoundation      0x367d11bf -[NSObject(NSObject) doesNotRecognizeSelector:] + 102 
    3 CoreFoundation      0x367d0649 ___forwarding___ + 508 
    4 CoreFoundation      0x36747180 _CF_forwarding_prep_0 + 48 
    5 CoreFoundation      0x3673af03 -[NSObject(NSObject) performSelector:withObject:] + 22 
    6 UIKit        0x35649f93 -[UIGestureRecognizer _updateGestureWithEvent:] + 562 
    7 UIKit        0x35649d57 -[UIGestureRecognizer _delayedUpdateGesture] + 22 
    8 UIKit        0x355b4afd _UIGestureRecognizerUpdateObserver + 436 
    9 CoreFoundation      0x367a4a35 __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 16 
    10 CoreFoundation      0x367a6465 __CFRunLoopDoObservers + 412 
    11 CoreFoundation      0x367a775b __CFRunLoopRun + 854 
    12 CoreFoundation      0x36737ec3 CFRunLoopRunSpecific + 230 
    13 CoreFoundation      0x36737dcb CFRunLoopRunInMode + 58 
    14 GraphicsServices     0x35ef141f GSEventRunModal + 114 
    15 GraphicsServices     0x35ef14cb GSEventRun + 62 
    16 UIKit        0x355e1d69 -[UIApplication _run] + 404 
    17 UIKit        0x355df807 UIApplicationMain + 670 
    18 MyAppName       0x000029a7 main + 70 
    19 MyAppName       0x0000295c start + 40 
) 

回答

0

您可以嘗試通過向您的單元添加一個來攔截呼叫。這與在編輯模式下拖動和移動單元格的能力沒有衝突。我的桌子都適合兩種。

在我 - (UITableViewCell的*)的tableView:(UITableView的*)的tableView的cellForRowAtIndexPath:(NSIndexPath *)indexPath

我附上一到每個單元:

UILongPressGestureRecognizer *longPressGesture = 
[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; 
[cell addGestureRecognizer:longPressGesture]; 
[longPressGesture release]; 
+0

嗨我有同樣的問題,我嘗試上面的公式,但它不適合我。其他解決方案? –

0

你可以發佈一些關於如何聲明你的tableview的更多細節嗎?如果聲明爲可編輯,則可以使用單元格右端的三行長按並拖動它,否則它會崩潰,因爲視圖不知道如何處理長按手勢。

+0

你有沒有找到任何解決辦法此? –