Open ModalViewController from UIView class

Discussion in 'iPhone Tips, Help and Troubleshooting' started by Sumitkum, Apr 29, 2009.

  1. Sumitkum macrumors newbie

    Joined:
    Apr 29, 2009
    #1
    Hi All,

    I want to open the modalViewcontroller from a UIView class.
    We can open the same from UIviewController with this command.:

    [viewController presentModalViewController:modal1 animated:YES];

    But, how we can open it from a UIview.
    [view presentModalViewController: modal1 animated:YES], doesn't work
     
  2. djcraze macrumors regular

    djcraze

    Joined:
    Jul 3, 2007
    #2
    You can't, it needs to be a view controller to present it as a model view. Its easy to make a UIView to a UIViewController.. Just create a UIViewController, and place a UIView inside it then call to the UIViewController...
     

Share This Page