vishdhmn / Surveys

Nibml3 Surveys
0 stars 0 forks source link

static method in singleton #3

Open theamorn opened 7 years ago

theamorn commented 7 years ago
+(NSArray*)getFeedItems{
    return [[self sharedController] getAllFeed];
}

why you have static method in singleton? isn't it destroy the usefulness of singleton?

vishdhmn commented 7 years ago

Hi, I am not sure of how it destroys the usefulness, never thought about it. Please help me here, may be I don't know something.

I wrote this method just to have easy access to the method. As now to call this I can use [N3FeedController getFeedItems]; instead of [[N3FeedController sharedController] getAllFeed]; But it is still a singleton. I tried searching for it also before, please let me know the issue it might cause if it is a bad coding practice.