What is factory methods ? What is the advantage of using it ?



What is factory methods ? What is the advantage of using it ?..

Answer / 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

More Apple iOS Interview Questions

What do you know about home screen of ios?

0 Answers  


Explain keywords alloc and new?

0 Answers  


How do you check if your code has memory leaks?

0 Answers  


What is called before viewdidload?

0 Answers  


What is the difference between weak and strong?

0 Answers  






An app is loaded into memory but is not executing any code. In which state will it be in?

0 Answers  


What is uiwindow in ios?

0 Answers  


Difference between cocoa, cocoa touch and objective c?

0 Answers  


What is ios technology?

0 Answers  


What is ipa?

0 Answers  


What is xcode used for?

0 Answers  


What is swift and what is objective-c?

0 Answers  


Categories