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

Explain the features is ios 6?

0 Answers  


List the devices compatible with ios 11? : IOS Architect

0 Answers  


What is ios application life cycle?

0 Answers  


what are all instruments available in Xcode?

0 Answers  


What size is 1x and 2x?

0 Answers  






Can you explain ios design patterns?

0 Answers  


What is use of nsoperation? How nsoperationque works?

0 Answers  


Explain arc?

0 Answers  


Explain the difference between strong and retain.

0 Answers  


Explain how app delegate is declared by Xcode project templates?

0 Answers  


Describe the functionality of accelerometer of an iphone ?

0 Answers  


What is nsoperation and nsoperationqueue?

0 Answers  


Categories