{"action":"opened","issue":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/4662","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/4662/labels{/name}","comments_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/4662/comments","events_url":"https://api.github.com/repos/lionheart/openradar-mirror/issues/4662/events","html_url":"https://github.com/lionheart/openradar-mirror/issues/4662","id":100644914,"number":4662,"title":"14618345: Setting a UITableViewCell accessoryType causes the the cell to disappear","user":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/reproducible:always","name":"reproducible:always","color":"5319e7"},{"url":"https://api.github.com/repos/lionheart/openradar-mirror/labels/status:resolved","name":"status:resolved","color":"444444"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/2","html_url":"https://github.com/lionheart/openradar-mirror/milestones/iOS","labels_url":"https://api.github.com/repos/lionheart/openradar-mirror/milestones/2/labels","id":1237416,"number":2,"title":"iOS","description":null,"creator":{"login":"openradar-mirror","id":13605213,"avatar_url":"https://avatars.githubusercontent.com/u/13605213?v=3","gravatar_id":"","url":"https://api.github.com/users/openradar-mirror","html_url":"https://github.com/openradar-mirror","followers_url":"https://api.github.com/users/openradar-mirror/followers","following_url":"https://api.github.com/users/openradar-mirror/following{/other_user}","gists_url":"https://api.github.com/users/openradar-mirror/gists{/gist_id}","starred_url":"https://api.github.com/users/openradar-mirror/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/openradar-mirror/subscriptions","organizations_url":"https://api.github.com/users/openradar-mirror/orgs","repos_url":"https://api.github.com/users/openradar-mirror/repos","events_url":"https://api.github.com/users/openradar-mirror/events{/privacy}","received_events_url":"https://api.github.com/users/openradar-mirror/received_events","type":"User","site_admin":false},"open_issues":775,"closed_issues":0,"state":"open","created_at":"2015-08-03T02:08:30Z","updated_at":"2015-08-12T22:01:31Z","due_on":null,"closed_at":null},"comments":0,"created_at":"2015-08-12T22:01:31Z","updated_at":"2015-08-12T22:01:31Z","closed_at":null,"body":"#### Description\n\nSummary:\r\n\r\nUpdating a UITableViewCell's accessoryType in a table view delegate's tableView:didSelectRowAtIndexPath: method causes everything in the cell but the newly set accessory to disappear: the cell background turns grey, and the textLabel and imageView disappear.\r\n\r\nSteps to Reproduce:\r\n\r\n1. Create a New Project, select Single View Application\r\n2. Open Main.storyboard, add Table View to the scene\r\n3. Connect table view's datasource and delegate to the scene's view controller\r\n4. Make a new referencing outlet from the table view to the view controller called `tableView`\r\n5. Open ViewController.m and add the following code:\r\n\r\nstatic NSString* cellId = @\"TestCell\";\r\n\r\n@implementation ViewController\r\n\r\n- (void)viewDidLoad {\r\n  [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:cellId];\r\n}\r\n\r\n#pragma mark - UITableViewDataSource\r\n\r\n- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {\r\n  return 1;\r\n}\r\n\r\n- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {\r\n  return 1;\r\n}\r\n\r\n- (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {\r\n  UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellId forIndexPath:indexPath];\r\n  if (cell == nil) {\r\n    cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId];\r\n  }\r\n\r\n  cell.textLabel.text = @\"Test cell\";\r\n\r\n  return cell;\r\n}\r\n\r\n#pragma mark - UITableViewDelegate\r\n\r\n- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {\r\n  UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellId forIndexPath:indexPath];\r\n  cell.accessoryType = UITableViewCellAccessoryCheckmark;\r\n}\r\n\r\nExpected Results:\r\n\r\nTapping on the single cell in the app should cause the checkmark to be displayed in the accessory view at the right of the table view cell.\r\n\r\nActual Results:\r\n\r\nThe checkmark is displayed, but the cell background becomes grey and everything else in the cell disappears.\r\n\r\nRegression:\r\n\r\nIt occurs with iOS 7 beta 4. Not tested on earlier iOS 7 versions, though it did not occur in iOS 6.\r\n\r\nNotes:\r\n\r\nIf the cell's image view is set, it will also disappear when the accessory type is set.\r\n\r\nIf an accessory view was previously set, it will also disappear. This is expected, but it should be emphasized that it seems to have no influence on the problem.\r\n\r\nResolved:\r\n\r\nAs it turns out, I was using dequeueReusableCellWithIdentifier:forIndexPath: incorrectly, using it in tableView:didDeselectRowAtIndexPath: when I should have been using cellForRowAtIndexPath:.\n\n-\nProduct Version: 7 beta 4\nCreated: 2013-08-01T12:19:28.184883\nOriginated: 2013-08-01T00:00:00\nOpen Radar Link: http://www.openradar.me/14618345"}}