Yes, you are right. I checked again and ARC is adding an autorelease to -notCrashing. Thanks for the clarification.
Post
Replies
Boosts
Views
Activity
Thanks for the fast and detailed response!
Makes total sense that KVO is meant to access properties only, but until now it was/is not forced for other methods than -copy.
If I extend my class and define a method like:
- (Sample *)notCrashing {
return [self copy];
}
and call it like [@[[Sample new]] valueForKey:@"notCrashing"]; it also returns a +1 ref count object, but it does not crash on iOS 17.
Or do I misunderstand?
Anyway I will change all places where KVC is used in that way before iOS 17 will be released to avoid crashes :-)