However, I have not met with any issues yet, but sometimes it might happen when we are using two completely independent frameworks, which might have two classes of common name. So, to resolve compiler ambiguity, how to specify that this class refers to this framework and this belongs to that framework. Like in Java, we can specify fully qualified class name like java.pkg.Class.
I know that all the classes are preceded by some characters those might identify the framework (like NS, SK, MK, etc.), but it still can happen. Is there any mechanism that I am missing? I have never heard of fully qualified class name in Objective C.
Asked
Active
Viewed 206 times
-1

Léo Natan
- 56,823
- 9
- 150
- 195

Sunil Chauhan
- 2,074
- 1
- 15
- 33
1 Answers
2
Objective-C does not have namespaces for its classnames. The class name (e.g. NSString
) is the fully-qualified class name; that's as qualified as it gets.
Obviously, this can lead to collisions. Some developers have filed bugs asking for namespaced classes in Objective-C, but as of this writing, nothing has been done in response to those requests.
So no, there is no mechanism that you're missing.

BJ Homer
- 48,806
- 11
- 116
- 129