Friday, December 23, 2011

No packages

There are no packages in objc unlike java/flex. All classes in objc are scoped as public equivalent in java/flex. To uniquely differentiate class names, developers should follow a thumb rule (ugly but worth it) when creating framework classes used by other developers:
Prefix the class name with keyword that uniquely describes your classes framework

An example is a classes that start with unique keyword "NS" for classes in cocoa framework - NSObject, NSString, NSRange etc.

Though the classes used only specific to your code and not to be used by other developers need not have this prefix, I personally would recommend it for you to easily recognize the class in a pile as it gets big.

No comments:

Post a Comment