문제

Lets say I'm creating an SDK for a company called "MyCompany" and its a unique company name. All the library classes are prefixed with "MC" only the main API library class "MyCompany.h" is not. Is this appropriate or should I also prefix that class too?

도움이 되었습니까?

해결책

I think that's appropriate. To make sure, I'd download some popular SDKs, and see what they do. Like Facebook, and others like that.

Also, note that technically, your class prefixes should be at least 3 characters, unless you're Apple. Per Apple. Although, I don't think a lot of people use that guideline.

Edit: I edited this because I didn't like my first answer...

다른 팁

MyCompany.h does not -- should not -- define any linkable symbols. It should only #import the rest of your framework's/library's headers.

Thus, there is no conflict because there are no actual unprefixed symbols defined; there should not be a MyCompany class, for example.

Your proposed naming scheme matches what Apple does as well as what many third-party libraries do.

I think that sounds like a reasonable way to name your library.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top