0

I want to wrap an object in Objective c, so that user can't initialise or change any parameter.

For example,

I am building restaurantManager module. So after initialisation user will call [restaurantManagerObject searchforAvailableDrink] which is a async call. It will invoke restaurantManager delegate didDrinkAvailable:(Drink*)drink.

I will create drink from lower layer and send it to the delegate. To do that I need to initialise Drink object and set the desired attributes to drink from another internal class.

But I don't want to make those APIs visible to the header. User will only get a ready made drink object where he can use some attributes and public methods.

How to do that ?

Sid Mhatre
  • 3,110
  • 1
  • 16
  • 37
Mubashwir Alam
  • 199
  • 1
  • 14

0 Answers0