I have a UIViewController
Class Aplha
that calls another UIViewController
Class Beta
in a modalView.
In Alpha.h
, I declared a function:
-(void)selectMyImage:(NSString *)myImage;
In Aplha.m:
#import "Beta.h"
-(IBAction)clickMe:(id)sender
{
Beta *b=[[Beta alloc]initWithNibName:@"Beta" bundle:nil];
b.delegate=self;
[self presentModalViewController:b animated:YES];
}
The above code shows the ViewCOntroller in modal view. I have an id delegate;
declared in my Beta.h
. Now when i try to call the function of Alpha
from Beta
class, it gives me error.
Here is my code in Beta.m
:
-(void)callAlpha
{
[delegate selectMyImage:imagename]; //imagename is declared in Beta.h too.
}
The Xcode shows the red error mark saying "No known instance method for selector 'mySelectedImage:'"
In iOS 4.x SDK it runs fine. and Here I have enabled the ARC also.