I’m trying to pass a value to a method in the delegate and return an NSString value. For some reason, i get a property not found on delegate error. I’d appreciate any help. Here is my code:
delegate.h
- (NSString*) getSoundFilePath:(int)pageNumber;
delegate.m
-(NSString*) getSoundFilePath:(int)pageNumber{
switch (pageNumber) {
case 1:
return soundFilePathPage1;
break;
case 2:
return soundFilePathPage2;
break;
case 3:
return soundFilePathPage3;
break;
case 4:
return soundFilePathPage4;
break;
case 5:
return soundFilePathPage5;
break;
case 6:
return soundFilePathPage6;
break;
}
return nil;
}
app.m
int page = 1;
NSString *audioFilePath = appDelegate.getSoundFilePath:page;
//that's where i get the error
You should look for an objective c introduction.
The correct line would be