Reputation: 1542
If I define a class Utils
like this:
@interface Utils: NSObject {
}
+ (NSInteger)getFreeSize;
who will get the message getFreeSize
when I use it like this [Utils getFreeSize];
?
Is any static instance created under the hood for Util
's representation at runtime? Who is the target for this message?
Upvotes: 1
Views: 47
Reputation: 119031
The class itself is the target, it's what you're calling the method on. There is an instance of the class object which exists, and then you can create instances of (instantiate) the class (there's a difference).
Upvotes: 2