Permalink
Browse files

Fixed a crash bug in LeftViewController.m

  • Loading branch information...
1 parent b625d83 commit c2fa747072b9d7544248d13c80c0082c89743b7f @Elegia Elegia committed May 8, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 ViewDeckExample/LeftViewController.m
@@ -151,7 +151,9 @@ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
if ([controller.centerController isKindOfClass:[UINavigationController class]]) {
UITableViewController* cc = (UITableViewController*)((UINavigationController*)controller.centerController).topViewController;
cc.navigationItem.title = [tableView cellForRowAtIndexPath:indexPath].textLabel.text;
- [cc.tableView deselectRowAtIndexPath:[cc.tableView indexPathForSelectedRow] animated:NO];
+ if ([cc respondsToSelector:@selector(tableView)]) {
+ [cc.tableView deselectRowAtIndexPath:[cc.tableView indexPathForSelectedRow] animated:NO];
+ }
}
[NSThread sleepForTimeInterval:(300+arc4random()%700)/1000000.0]; // mimic delay... not really necessary
}];

0 comments on commit c2fa747

Please sign in to comment.