#import "PsychologistViewController.h"
#import "HappinessViewController.h"
@interface PsychologistViewController()
@property (nonatomic) int diagnosis;
@end
@implementation PsychologistViewController
@synthesize diagnosis = _diagnosis;
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"ShowDiagnosis"]) {
[segue.destinationViewController setHappiness:self.diagnosis];
}
else if ([segue.identifier isEqualToString:@"Celebrity"]) {
[segue.destinationViewController setHappiness:100];
}
else if ([segue.identifier isEqualToString:@"Serious"]) {
[segue.destinationViewController setHappiness:20];
}
else if ([segue.identifier isEqualToString:@"TV Kook"]) {
[segue.destinationViewController setHappiness:50];
}
}
****- (void)setAndShowDiagnosis:(int)diagnosis****
{
self.diagnosis = diagnosis;
[self performSegueWithIdentifier:@"ShowDiagnosis" sender:self];
}
-(IBAction)flying
{
[self setAndShowDiagnosis:85];
}
-(IBAction)apple
{
[self setAndShowDiagnosis:100];
}
-(IBAction)dragons
{
[self setAndShowDiagnosis:20];
}
-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return YES;
}
@end
My question pertains to the - (void)setAndShowDiagnosis:(int)diagnosis
method. This method is undeclared anywhere as either public in any .h file and obviously it's not there privately either. My question is why the reason for this would be? It just shows its setter implementation but the actual method declaration appears nowhere. Any help to clarify this is appreciated. Oh and this is from an online lecture and everything compiles just fine and runs.