MobileApp Developer
MobileApp Developer

Reputation: 382

Why Class name appended with _private.h word

I have an existing code where i can see, ClassName.h,ClassName.m and ClassName_private.h, here i have doubt that whats the use of having ClassName_private.h.

Thanks a lot in advance

Upvotes: 1

Views: 248

Answers (1)

AdamPro13
AdamPro13

Reputation: 7400

Some developers will use this pattern of setting up a category like you described to mimic protected and private behavior like you can see in other languages (such as C++). You import the private header into classes you think should have access to those methods. This allows you to only expose those methods to certain classes.

Upvotes: 2

Related Questions