{"id":5168,"date":"2014-03-30T19:19:38","date_gmt":"2014-03-30T19:19:38","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/deleting-rows-from-a-static-uitableview-at-runtime-collection-of-common-programming-errors\/"},"modified":"2014-03-30T19:19:38","modified_gmt":"2014-03-30T19:19:38","slug":"deleting-rows-from-a-static-uitableview-at-runtime-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/deleting-rows-from-a-static-uitableview-at-runtime-collection-of-common-programming-errors\/","title":{"rendered":"Deleting rows from a static UITableView at runtime-Collection of common programming errors"},"content":{"rendered":"<p>I don&#8217;t know about &#8220;delete&#8221; but you can hide the row using <code>tableView:heightForRowAtIndexPath:<\/code>.<\/p>\n<pre><code>- (void)methodToToggleAddr2CellVisibility\n{\n    self.addr2CellIsHidden = !self.addr2CellIsHidden;\n    [self.tableView beginUpdates];\n    [self.tableView endUpdates];\n}\n\n- (float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath \n{\n    if (indexPath.section == 1 &amp;&amp; indexPath.row == 1) { \/\/ the cell you want to hide\n        if (self.addr2CellIsHidden == YES) {\n            return 0;\n        } else {\n            return 44;\n        }\n    }\n    return 44;\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I don&#8217;t know about &#8220;delete&#8221; but you can hide the row using tableView:heightForRowAtIndexPath:. &#8211; (void)methodToToggleAddr2CellVisibility { self.addr2CellIsHidden = !self.addr2CellIsHidden; [self.tableView beginUpdates]; [self.tableView endUpdates]; } &#8211; (float)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 1 &amp;&amp; indexPath.row == 1) { \/\/ the cell you want to hide if (self.addr2CellIsHidden == YES) { return 0; } else [&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-5168","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5168","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=5168"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/5168\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=5168"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=5168"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=5168"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}