Here is my code
#import "MasterViewController.h"
#import "DiseaseResultsViewController.h"
@interface MasterViewController ()
@end
@implementation MasterViewController
@synthesize symptomTextField;
- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@"searchFunctionSegue"])
{
if ([self.symptomTextField.text length])
{
DiseaseResultsViewController *resultsViewController = [segue destinationViewController];
resultsViewController.symptomSearchString = self.symptomTextField.text;
}
}
}
@end
I am getting an "Expected selector for Objective-C method" error on the "if ([self.symptomTextField.text length]) line
and a "expected method body" and "missing @end" error in the line below the "DiseaseResultsViewController *resultsViewController = [segue destinationViewController]" line
and I already checked all my imported files have their @end correctly.
Any ideas?
In my case the error was reported in the .h:
But the problem was in the .m:
There was a typo, I enter a + by mistake.
This was one of the most frustrating and silly errors I've seen. I just cut and then pasted back in the code and the errors disappeared :S
I had same error, I have written "+" sign in .m
file` by mistake.
After seeking code half an hour, I remove "+"
sign and error was gone.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With