开发者

Namespaces and objective C

开发者 https://www.devze.com 2023-03-01 13:47 出处:网络
In c# I use namespaces in java I use packages.Is there a way to keep cl开发者_Go百科assnames short in objective c?Objective-C only has one, single global namespace. That is why you often see classes c

In c# I use namespaces in java I use packages. Is there a way to keep cl开发者_Go百科assnames short in objective c?


Objective-C only has one, single global namespace. That is why you often see classes called SBJsonParser, so that the class name doesn't collide with other JsonParsers out there.

The general recommendation I have seen is to prefix your classes with either your initials or with a few initials for the project you are working on, the class name, then (sometimes) what "type" of class they are (as is the apparent convention for view controllers).

Honestly, I am right there with you Mel, I would be absolutely exhilarated for Objective-C to add some sort of namespacing feature, at least something to sort out classes a bit more (and a bit easier).

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号