Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hiding/Showing UITableViewCell Accessory Disclosure Indicator

I am trying to load a string from Core Data and if that value in that row equals to "--" the Accessory Disclosure Indicator will hide and the cell selection style should be SelectionStyleNone.

I tried this, but not successful

if (entity.value == @"--"){     cell.selectionStyle = UITableViewCellSelectionStyleNone;       cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; }   

Or

NSString *this = entity.value; if (this == @"--") {     cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;     cell.selectionStyle = UITableViewCellSelectionStyleNone; } 

Neither are working, but is this possible though? Thanks.

like image 637
S Arumik Avatar asked Mar 09 '11 15:03

S Arumik


People also ask

How to hide disclosure indicator SwiftUI?

For the navigation link, instead of presenting the Text view, we change it to display an empty view. And, we attach the opacity modifier to NavigationLink and set its value to 0 . If you test the change in the preview, the disclosure indicator should disappear.

How do you add a disclosure indicator?

If you want the '>' show up by default, goto the storyboard, click on the cell, goto the fourth tab on the right hand side, select the accessory as 'Disclosure Indicator'. ATTENTION! The real option you want is Disclosure Indicator , not None .


1 Answers

I think that the problem is on the comparison expression. The correct way:

if ([entity.value isEqualToString:@"--"]) 

or

if ([this isEqualToString:@"--"]) 
like image 139
Rafael Afonso Avatar answered Sep 21 '22 09:09

Rafael Afonso