I am converting some Objective C code to C# for use in a Monotouch iPhone app.
In Objective C, the following equivalence condition is tested:
if ([cell.backgroundView class] != [UIView class])
... do something
cell is a UITableViewCell
.
In C#, I'd like to test the same condition using (so far) the following:
if ( !(cell.BackgroundView is UIView))
... do something
Is the understanding of the Objective C code correct, i.e. it tests the type of cell
? What would the equivalent be in C#?
Looks right, unless UITableViewCell
inherits from UIView
.
in which case you'll need
if (cell.BackgroundView.GetType() != typeof(UIView))
... do something
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