After changing a setting and removing a subview from a UITableDetailView, I get 
crashes when I accidentally swipe the detail view.

This is the crash message:

VM Regions Near 0xa7c98f9b:
    __LINKEDIT             000000008feea000-000000008fefd000 [   76K] r--/rwx 
SM=COW  /usr/lib/dyld
--> Submap                 0000000090000000-00000000ac400000          r--/rwx 
machine-wide submap
    mapped file            0000000090000000-000000009173e000 [ 23.2M] r-x/r-x 
SM=COW  Object_id=28939148

Application Specific Information:
objc_msgSend() selector name: tableView:editingStyleForRowAtIndexPath:
iPhone Simulator 272.21, iPhone OS 5.1 (iPad (Retina)/9B176)


Thread 0 Crashed:
0   libobjc.A.dylib                 0x0291109b objc_msgSend + 15
1   UIKit                           0x0138c997 
-[UITableView(_UITableViewPrivate) _editingStyleForRowAtIndexPath:] + 90
2   UIKit                           0x013a1e74 
-[UITableView(UITableViewInternal) _indexPathForSwipeRowAtPoint:] + 456
3   UIKit                           0x01398792 -[UITableView 
_gestureRecognizerShouldBegin:] + 135
4   UIKit                           0x015cb0be -[UIGestureRecognizer setState:] 
+ 240
5   UIKit                           0x016217d2 -[UISwipeGestureRecognizer 
touchesMoved:withEvent:] + 1061
6   UIKit                           0x0132cf20 -[UIWindow 
_sendGesturesForEvent:] + 479
7   UIKit                           0x0132d532 -[UIWindow sendEvent:] + 93
8   UIKit                           0x01313dc4 -[UIApplication sendEvent:] + 464
9   UIKit                           0x01307634 _UIApplicationHandleEvent + 8196
10  GraphicsServices                0x02ed7ef5 PurpleEventCallback + 1274
11  CoreFoundation                  0x0086f195 
__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 53
12  CoreFoundation                  0x007d3ff2 __CFRunLoopDoSource1 + 146
13  CoreFoundation                  0x007d28da __CFRunLoopRun + 2218
14  CoreFoundation                  0x007d1d84 CFRunLoopRunSpecific + 212
15  CoreFoundation                  0x007d1c9b CFRunLoopRunInMode + 123
16  GraphicsServices                0x02ed67d8 GSEventRunModal + 190
17  GraphicsServices                0x02ed688a GSEventRun + 103
18  UIKit                           0x01305626 UIApplicationMain + 1163

I don't think I even want the detailView to have swipe gestures enabled, so I 
added this code:

#pragma mark -
#pragma mark Settings support

- (void)settingsViewControllerDidEnd:(IASKAppSettingsViewController*)sender {
    NSLog(@"%s", __FUNCTION__);

    [self dismissModalViewControllerAnimated:YES];
    [[NSUserDefaults standardUserDefaults] synchronize];
    [self.view removeGestureRecognizer:self.swipeLeftRecognizer];
    [self.view removeGestureRecognizer:self.swipeRightRecognizer];

    for (UIView *subview in [self.view subviews]) {
        [subview removeFromSuperview];
        [subview removeGestureRecognizer:self.swipeLeftRecognizer];    
        [subview removeGestureRecognizer:self.swipeRightRecognizer];
        clear = 1;
        //NSLog(@"Clear is %i", clear);
    }
    [self viewDidLoad];


}
I repeated the code to stop swipes as I used to work for the Department of 
Redundancy Department.

I would appreciate any help in how to track where this problem is originating, 
and where it starts :)

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to