IPhone Get Parent View of UITextField

20,660

Solution 1

You can use myTextField.superview. It's documented in Apple's class reference for the UIView class, which UITextField inherits from.

Solution 2

It's myTextField.superview.

Share:
20,660
IPadHackAndSlash
Author by

IPadHackAndSlash

Updated on July 09, 2022

Comments

  • IPadHackAndSlash
    IPadHackAndSlash almost 2 years

    I have a UITextField control and I just want to get the parent view that it is contained in. I was hoping it would be something like [MyTextField ParentView] or MyTextField.view but no go.

    Any ideas?

    Thanks In Advance