what is equivalent to Java packages in iPhone OS?
I want to know which is the equivalent concept of Java packages in iPhone. Is it bundling or Static library?开发者_如何学C
Java Packages imply namespace, which doesn't exist in Objective-C. However, XCode supports Groups for managing common code (basically placed in their own directory). Libraries are typically delivered as a Framework.
This are added to a project as a framework.
For example,
- Address Book
- OpenGL
- Third Party
Java packages are used to avoids namespace collision, which is a situation where two pieces of code have the same name but do different things.
To do this in objective C - add prefix your class names with initials. All class created in cocoa framework have a prefix 'NS'. You can define your own prefix for your code.
精彩评论