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 is App Bundle in iOS operating system?
What is difference between atomic and nonatomic in ios?
An app is loaded into memory but is not executing any code. In which state will it be in?
What is ios appdelegate?
Which object is create by uiapplicationmain function at app launch time?
What is a category and when is it used?
How can mobile application errors be prevented?
What is singleton design pattern in ios?
what are the source items used by Xcode?
What are the important delegate methods of nsxml parser?
What are all the difference between categories and subclasses in iOS operating system?
What is the responder chain?
What is encapsulation in ios?
So how is the new look different from the old look?
Explain stack and heap?