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 |
What does mean in xcode?
What is the use of synchronized() block in objective c?
Explain what is @synthesize in objective-c?
Is objective c still used?
Can you please explain the way messaging works in objective-c?
What is the difference between property and instance variable?
How to make a code snippet thread safe?
Why is objective c better than swift?
What are the three main types of property?
What type of language is objective c?
What is a function file?
How do you call a method in objective c?