What is factory methods ? What is the advantage of using it ?
Answer Posted / babu
Class factory methods are implemented by a class as a convenience for developers. These methods combine allocation and initialisation in a single step and return the created object.
NSDate:
Eg: + (id)dataWithBytes:(const void *)bytes length:(unsigned)length;
NSDictionary
Eg:+ (instancetype)dictionary;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What are all the newly added frameworks iOS 4.3 to iOS 5.0?
What is mvc? Mvc architecture of iphone app.
How do I exit safe mode on my iphone?
What happens if the methods doesn’t exist?
Different types of persistent stores? Which all types can we have on ios?
What is a weak var?
Why iphone apps are popular?
What are b-trees?
What are lifecycle events of uiviewcontroller?
Tell me the hierarchy of uibutton.
What is appdelegate?
Explain ios switching applications?
what are the source items used by Xcode?
Assume that an app is not in foreground but is still executing code. In which state will it be in?
What is the meaning of 'synthesize' keyword?