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.
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.
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 .
I think that the problem is on the comparison expression. The correct way:
if ([entity.value isEqualToString:@"--"])
or
if ([this isEqualToString:@"--"])
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With