What is the difference between underscore and self (i.e self.xx and _xx) ?
Answer / Son Dev Jatav
In Objective-C, 'self' refers to the current object instance. When using 'self', you access instance variables with a dot notation like 'self.variable'. An underscore '_' is often used as an ivar (instance variable) prefix in Objective-C classes for consistency with C coding style. However, it has no special meaning in Objective-C and can be replaced with self or any other valid name.
| Is This Answer Correct ? | 0 Yes | 0 No |
Is objective c and c the same?
What is extern objective c?
What is a category extension?
Is struct a class?
Is method and function same?
What is gcd? What are its advantages over nsthread?
Explain the types of protocol?
What is the primary use of the category in the objective-c?
What are the rules of variable?
Can we implement dealloc in arc? If yes, what is the need to do that?
What are kvc and kvo? Provide an example.
What is autoclosure?