Answer the question
In order to leave comments, you need to log in
How to call a method in Objective c?
For some reason, the method in Objective c stubbornly refuses to be called. He wrote in different ways, took examples and all in vain.
#import <Foundation/Foundation.h>
@interface Greeting : NSObject
- (void)sayHello;
@end
@implementation Greeting
- (void)sayHello {
NSLog(@"Hello, World!");
}
@end
int main(){
Greeting *v= [[Greeting alloc]init];
[v sayHello];
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question