I
I
Ivan Istomin2013-12-24 21:39:23
Objective-C
Ivan Istomin, 2013-12-24 21:39:23

How is method declaration different in Objective-C?

For example:

@interface Fraction : NSObject
@property double numerator, denominator;

-(void) setTo: (double) r over: (double) i;
-(void) reduce;
+(Fraction *) allocF;
+(int) count;

@end

So what is the difference between + at the beginning and -?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey Solovey, 2013-12-24
@Istom1n

Just a few hours ago there was a discussion here:
Class Method and Object Method in Objective-C
Briefly, + declares a class method, - an object method.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question