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?
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).