Hi I am trying to call a method from another class and it is not working.
Here is the method I want to call, "updateName".
@interface Content1ViewController ()
@end
@implementation Content1ViewController
+ (void)updateName:(id)sender {
NSLog(@"IT WORKED");
}
- (void)viewDidLoad {
[super viewDidLoad];
}
@end
Then I try call it in a method from another class.
-(void)randomMethod {
[Content1ViewController updateName];
}
Then I get a error at "update name" as it doesn't recognise the method? I followed this answer and its not working for me. I have made sure I have imported the classes to each other aswell.
Can someone please tell me why its not working? Thanks.