In My project i display an viewController from class
settings.m
in that viewController after an touch button event called,i calling to local function that display webView with animation after loading java script like this:
[self.webView setFrame:CGRectMake( 0.0f, 480.0f, 320.0f, 480.0f)];
[UIView beginAnimations:@"settingsAnimate" context:nil];
[UIView setAnimationDuration:1.5];
[self.webView setFrame:CGRectMake( 0, 120, 320, 320)];
[self.viewController.view addSubview:self.webView];
[UIView commitAnimations];
its working…
but now i want to call if when event happens in other class,so I created an function with that code below in settings.m and after my event happens i calling to that function from that class:
settings *ss = [settings alloc];
[ss showAnimation];
I get in into that function in settings.m but nothing happens…what could be the problem?
Tryied using delegate: in my Options.m, its comming into the function but the webView dont chage.
@protocol IGameP
- (void) showAnimation;
@end
@interface options : CDVPlugin<IGameP>{
id <IGameP> delegate;
}
@property (nonatomic,assign) id <IGameP> delegate;
in
options.m:
settings *s1t = [settings alloc];
[self setDelegate: s1t];
[self.delegate showAnimation];
Use delegate for backward messaging (ie calling function in other classes). As such u want to take effect of your requirement in a view from another view best is to use delegate