{"id":6434,"date":"2014-04-18T05:22:16","date_gmt":"2014-04-18T05:22:16","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/tableviewcaneditrowatindexpath-crash-when-popping-viewcontroller-collection-of-common-programming-errors\/"},"modified":"2014-04-18T05:22:16","modified_gmt":"2014-04-18T05:22:16","slug":"tableviewcaneditrowatindexpath-crash-when-popping-viewcontroller-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/04\/18\/tableviewcaneditrowatindexpath-crash-when-popping-viewcontroller-collection-of-common-programming-errors\/","title":{"rendered":"tableView:canEditRowAtIndexPath: crash when popping viewController-Collection of common programming errors"},"content":{"rendered":"<p>I have a viewController with a <code>UITableView<\/code>, the rows of which I allow to edit (delete) with a swipe &#8211; much like in the Mail app. I do it with, among other, this method:<\/p>\n<pre><code>- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {\n\n    return YES;\n}\n<\/code><\/pre>\n<p>However, if I have a delete button revealed, and at the same time I use back navigation of my <code>UINavigationController<\/code>, i.e. when I <code>popViewControllerAnimated:<\/code>, the app crashes with the following message:<\/p>\n<p><strong>[ViewController tableView:canEditRowAtIndexPath:]: message sent to deallocated instance 0xaae64d0<\/strong><\/p>\n<p>How can I resolve this problem?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have a viewController with a UITableView, the rows of which I allow to edit (delete) with a swipe &#8211; much like in the Mail app. I do it with, among other, this method: &#8211; (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath { return YES; } However, if I have a delete button revealed, and at the same [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-6434","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=6434"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/6434\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=6434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=6434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=6434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}