If you’re being lazy, just use the selector for the getter: [cell.dataField property]. It might not perform checking, but it will work if the selector is defined.
Saagar Jha > On Jan 17, 2018, at 17:24, Alex Zavatone <z...@mac.com> wrote: > > Xcode 9.2, iOS 11.2 > > In a UITableViewCell subclass, I have a subclass of UITextField, which insets > the text being entered by 10 pixels. > > The InsetUITextField interface is below. It clearly inherits from > UITextField: > > @interface InsetUITextField : UITextField > > In the UITableViewCell subclass, I import the InsetUITextField.h and have a > property called dataField. It looks like this: > > @property (strong, nonatomic) IBOutlet InsetUITextField *dataField; > > The outlet is correctly wired up to the InsetUITextField within the expected > UITableViewCell subclass cell in one and only one scene in the storyboard. > > The class of the custom cell and the InsetUITextField within the storyboard > scene are correct and the identifier on the cell is correct. > > Naturally, this UITextField subclass exists to allow the user to enter text > within a UiTableViewCell subclass and it works. > > Right now, I have tapped on the field and the keyboard is displayed. In the > debugger, I can print the object. > > po cell.dataField > <InsetUITextField: 0x7ff9b68fd000; baseClass = UITextField; frame = (335 20; > 97 34); text = ''; opaque = NO; autoresize = RM+BM; gestureRecognizers = > <NSArray: 0x608000259860>; layer = <CALayer: 0x608000228320>> > > But I can’t access any property of that object. > > Here is the problem. > > po [cell.dataField isKindOfClass:[UITextField class]] > error: reference to 'UITextField' is ambiguous > candidate found by name lookup is 'UITextField' > candidate found by name lookup is ‘UITextField' > > Am I right in assuming that Xcode thinks that the subclass has 2 possible > UITextField parent classes? > > Thanks. > > Alex Zavatone > > > > _______________________________________________ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/saagar%40saagarjha.com > > This email sent to saa...@saagarjha.com _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com