Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Hijacker

macrumors newbie
Original poster
Apr 25, 2009
6
0
Hello everybody I'm asking for your assistance once again because I have a problem and apparently I can't find an answer over the web, good and simple enough to understand the solution.So, let's say I have an UIViewController called TestViewController and a UIView callled TestView.

Code:
@interface TestViewController : UIViewController 
      TestView *testView;
@end

@property  (nonatomic, retain) TestView *testView;

@implementation 

- (void)someTapActionOnInterface {
   [testView method1];
after this I need somehow to retreive some value and use it here when metho2 from TestView executes
}

@end


////////////////////TestView//////////////////////

@interface TestView : UIView
         NSString* aString;
@end

@property (nonatomic, retain) NSString *aString;

- (void) method1;
- (void) method2;


@implementation TestView

- (void) method1 {
    [UIView begintAnimation:nil context:NULL];
    [UIView setAnimationDelegate:self];  
    [UIView setAnimationDidFinishSelector:@selector(method2:)];
     do some transformations here
    [UIView commitAnimations]; 
}

- (void) method2 {
    here i would like to send a int value to TestViewController and use that value there
}


@end

In the pseudo code above you can see that my UIView is an ivar in UIControllerView which is instantiated and linked to the app window. When I tap on interface I need to do some animation on the view and than when animation is done I need to make some calculation and send this back to the ViewController. How can I achieve this, I tried to understand examples like LocateMe to figure out how delegates work but it seems that it's to elaborated for me. Can anyone point me in the right direction maybe with some simple sample code too? Any source or starting point is very welcome. I hope I was clear enough for you to understand my question. Thank you.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.