Welcome to the iMore Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 2 of 2
  1. Thread AuthorThread Author   #1  
    Krisiacik's Avatar
    iPhone Nanite

    1 Posts

    Default How to animate when no reference to target view?


    In my iOS5 app for iPhone, I have something like this

    ivar ViewController1
    ivar ViewController2

    ivar view1
    ivar button1
    IBAction animateToView

    ivar view2

    Now I want to animate from view1 from viewcontroller1 to view2 from viewcontroller2 by pushing a button in viewcontroller1.
    Bu I do not have a reference to the view2 to the viewcontroller2 in viewcontroler1.

    If I hook the button to an action/target and use block based animation in it
    this one >>

    [UIView transitionFromView:<#(UIView *)#>
    toView:<#(UIView *)#>
    completion:<#^(BOOL finished)completion#>]
    I am unable to fill in the toView: because of those missing references.

    What would you recommend? IS it even good to solve thi by action target?

  2. #2  
    mOOncOw interactive's Avatar
    iPhone Newbie

    35 Posts


    You should read up on iOs Development - your question is a classical case for a navigation controller (look up UINavigationController for how to do it).

    And you can always expose the controller references in your app delegate by making them properties (@property (nonatomic, strong) UIViewController* viewController1; ), and then just get them anywhere in your app by calling (MyAppDelegate*)([Application sharedApplication].delegate).viewController1.

Tags for this Thread

Posting Permissions