I feel I've asked this question before but google doesn't think I have. 

My code is dealing with a button press in a control on a UITableViewCell in a 
UITableView which is contained in another UIView subclass and on and up through 
several views until eventually there is a topmost UIView which was presented 
from a UIViewController subclass. I want the button press to pop up a modal 
UIImagePickerController which will eventually pick the image for the cell I'm 
in. To pop it up I need a UIViewController instance to pop it up from, and to 
pop it down again afterwards. 

Is there any way to find, given a UIView, what the closest presenting 
UIViewController is? 

I tried going the other way, used [ [ UIView window ] rootViewController ] to 
pop up the image picker, that pops it up fine, but popping it down leaves a 
black screen, not really surprising, that's not the UIViewController which was 
really the controller at the point I pushed it, that's the root one, there's a 
few on the stack after that. I wasn't able to find a way to navigate down the 
UIViewController stack to find the bottom one, even if I could it sounds a bit 
fragile. 

Do I really need to pass the UIViewController down through why whole view 
hierarchy to my UITableViewCells so they know what to use for a modal popup and 
down; or crawl upwards superview by superview until I find one which perhaps 
implements some interface telling me it knows what the UIViewController which 
presented it was? 

I must have missed a method somewhere which does this. This is iOS 4.x on the 
phone.  _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (xcode-us...@lists.apple.com)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/rols%40rols.org

This email sent to r...@rols.org
_______________________________________________

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to