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 |
What is nsobject in ios?
Why we use delegate in ios?
In a single model, can I have few entities in one sqlite db file and remaining in another sqlite db file?
When was ios invented?
What is weak and strong in ios?
What does static analyser do?
How can mobile application errors be prevented?
How is the app delegate is declared by Xcode project templates?
What is messaging? How does the runtime handle message passing? What is message forwarding?
Why do all model object attributes get marked with @dynamic and not synthesised? What does @dynamic mean?
What is the difference between atomic and non-atomic properties? Which is the default for synthesized properties? When would you use one over the other?
Define 'strong' keyword?