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 transient properties?
What is delegate method?
Explain your process for tracing and fixing a memory leak iOs?
How to find the memory leaks in mrc?
What is meaning of 'assign' keyword?
What is the difference between strong and retain.
Explain interfaces?
What is retain counts?
What is the ? In swift?
What is called before viewdidload?
Explain formal protocols?
So how is the new look different from the old look?
What is mvvm in ios?
Explain what is garbage collection?
Define 'atomic' keyword?