I am new to iphone development.I want to to access the instance variable declared in uiview from its uiview subview.please help me out .Thanks.
I am new to iphone development.I want to to access the instance variable declared
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Technically, you can just do
[[self superview] foo]from within one of the child’s instance methods and that will give you access to thefooproperty on the parent (you may have to cast the superview, though). But something to consider is that in hierarchical data structures (like the UIView hierarchy), it’s generally good practice for children to not “know” too many of the details of their parents, where possible.