Re: finding my UIViewController
Re: finding my UIViewController
- Subject: Re: finding my UIViewController
- From: Matt Neuburg <email@hidden>
- Date: Thu, 04 Aug 2011 11:25:21 -0700
On Thu, 04 Aug 2011 00:07:40 +0800, Roland King <email@hidden> said:
>Is there any way to find, given a UIView, what the closest presenting UIViewController is?
Walk the responder chain until you come to a UIViewController?
UIResponder* r = self;
while (![r isKindOfClass: [UIViewController class]])
r = [r nextResponder];
m.
--
matt neuburg, phd = email@hidden, <http://www.apeth.net/matt/>
A fool + a tool + an autorelease pool = cool!
Programming iOS 4!
http://www.apeth.net/matt/default.html#iosbook_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden