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 polymorphism in objective-c?
What is responder chain?
How to call methods in objective c?
What is super in objective c?
What is the difference between typedef and enum?
What does alloc mean in objective c?
What is typedef objective c?
Distinguish between @synthesize and @dynamic in objective –c?
What is assign property in objective c?
What is hashable?
What is lazy var?
Explain what is @synthesize in objective-c?