What is the difference between underscore and self (i.e self.xx and _xx) ?
Answer Posted / 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 |
Post New Answer View All Answers
No New Questions to Answer in this Category !! You can
Post New Questions
Answer Questions in Different Category