0

i have Just In time property, which was working fine but now xcode 11.4 started complaining about it. please look at following code

- (UITextField *)searchTextField
{
    if (!_searchTextField)
    {
        _searchTextField = [self firstSubViewOfKindOfClass:[UITextField class]];
    }
    return _searchTextField;
}

Error :Use of undeclared identifier '_searchTextField'

i have a property defined for it like below

@property (nonatomic, strong) UITextField  *searchTextField;
2
  • Which line is the error reported on? The if (!_searchTextField) line? Commented Mar 27, 2020 at 20:10
  • WFM. How/where is firstSubViewOfKindOfClass defined? Commented Mar 27, 2020 at 20:26

1 Answer 1

1

You have a name clash. You cannot define a searchTextField because there already is a searchTextField (in iOS 13):

https://developer.apple.com/documentation/uikit/uisearchbar/3175433-searchtextfield

So you could just delete your code, as it isn't needed in iOS 13. Or if you need to support iOS 12 and earlier, you could give your property a different name that doesn't clash.

Sign up to request clarification or add additional context in comments.

1 Comment

I’m not clear on that, but it seems to be similar to stackoverflow.com/questions/60870129/…. The Cocoa namespace, or the nature of its exposure, seems to have changed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.