Reputation: 33090
The outlet from xib?
Is there a way to make it private?
In fact, I am pretty confused with objective-c. Isn't the idea of object oriented presuppose encapsulation?
Upvotes: 1
Views: 530
Reputation: 119242
You are right, if outlets are only relevant to the implementation of a class then they should not be "public" (declared in the .h file).
You can declare outlets in a class extension inside the .m file. These will be recognised by interface builder.
In Xcode 4.3, view controller subclasses created from templates have this class extension added automatically for this purpose. Ctrl-dragging into the .m file using the assistant editor will create new outlets.
Upvotes: 6
Reputation: 5555
it is sort of possible, but not truly :-)
a 'trick' way would be something on the lines of: Tutorial: Encapsulation
and also check out this question, with a great discussion: Why doesn't Objective-C support private methods?
Upvotes: 1