Can you write setter method for a retain property?
Answer / Jitendra C Kanaujia
Yes, you can write a setter method for a retain property. In Objective-C, it would look something like this: - (void)setProperty:(id)newValue { if (newValue != self.property) { [self willChangeValueForKey:@"property"]; self.property = newValue; [self didChangeValueForKey:@"property"]; } }
| Is This Answer Correct ? | 0 Yes | 0 No |
What is a block objective c?
Explain the difference between #import and #include in objective-c?
What are the two types of m files?
Why create a custom view?
What is enum in objective c?
Can you learn swift without knowing objective c?
What happens if you add your just created object to a mutable array, and you release your object?
What is retain count?
What is the definition of an objective statement?
What is a class in objective c?
What is the major difference between objective c and swift?
What is a class property?