Can Someone explain me few things regarding the Singleton implementation in Apple's documentation here.
Go to Creating a Singleton Instance in the link.
I tried but couldn't understand few things:-
- What does [super allocWithZone:NULL] in + (MyGizmoClass*)sharedManager does.?
- Why does allocWithZone call sharedManger method and return a retain call on its return type when retain itself returns self ?
- If the Singleton has some instance variables in it, where should they be initialized ?
If anyone could briefly explain working of allocWithZone and sharedManager methods here , a lot of these questions would automatically be answered.