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
Explain formal protocols?
Why do we use synchronized ?
What is difference strong and weak reference ? Explain.
What are “strong” and “weak” references? Why are they important and how can they be used to help control memory management and avoid memory leaks?
Multitasking support is available from which version in iOS operating system?
How do I open a csv file on my phone?
Explain me does ios support multitasking?
How to download xcode for iphone development?
Which programming language is used in ios?
How would you create your own custom view in iOS operating system?
Explain differences between foundation and corefoundation
Can you please explain the difference between nsarray and nsmutablearray?
What language is ios written in?
What is the methods for unzip file in AFNetworking
What is xib?