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
Can we support the same application for iphone 3gs and iphone 5, 6, 7? Why not?
How can we achieve singleton pattern in iOS?
How to de-symbolicate crash log?
How do I create a class in xcode?
what are fetched properties? How do you create a fetched property?
How to animate view with constraint?
Who is the developer of ios?
Explain how to shut off message alerts in ios?
What is a weak var?
What is ios realm?
How to use reusable cell in uitableview?
What is storyboard?
Define iterator protocol?
What is strong in ios?
Difference between iOS 3 , iOS4, iOS 5, iOS 6, iOS 7 and iOS 8 (What are the new features)