Tuesday, 17 September 2013

What is a point to use retain method on singleton object in Objective c?

What is a point to use retain method on singleton object in Objective c?

I was just wondering if any point to use retain over singleton object. I
believe the whole point of using singleton pattern is to keep one global
object to access from various classes. What would be a case to use retain
on singleton object? Generally implementation of retain on singleton class
return self (not singleton instance) like below:
-(id)retain
{
return self;
}
What would happen if anyone retain it and attempt to access on it? Thanks

No comments:

Post a Comment