Original title: _* Terminating app due to uncaught exception 'RLMException', reason: 'Property names beginning with 'new' are not supported. Swift follows ARC's ownership rules for methods based on their name, which results in memory leaks when accessing properties which return retained values via KVC.'_
I got an error after I update realm form 2.1 to 2.4.3:
* Terminating app due to uncaught exception 'RLMException', reason: 'Property names beginning with 'new' are not supported. Swift follows ARC's ownership rules for methods based on their name, which results in memory leaks when accessing properties which return retained values via KVC.'
how can I fix it
We have received the same error when upgrading from 2.4.2 to 2.4.3.
However, 2.4.3 claims to not have any breaking API changes:
https://github.com/realm/realm-cocoa/releases/tag/v2.4.3
Presumably due to #4633. Thoughts, @tgoyne?
It is not listed as a breaking change because properties with such names appeared to never have worked in the first place, and the goal of the change was just to make it fail in a more understandable way. Do you have an example of a model which works correctly with Realm 2.4.2 which is rejected by 2.4.3? It may be that the check is overly broad.
We did have a model that had a property called newValue but it wasn't being used yet, so we didn't see it as a problem. We have renamed our property and should be good to go now.
Thanks for the feedback guys.
@tgoyne my data model has no property with prefix 'new',it works correctly in Realm 2.1.0 ,but is failed in 2.4.3.

@Jinkeycode, are those all of the properties declared in your class? Is that your only model class? None of those names look like they'd be rejected by the check added by #4633.
@bdash,oh!it's not the only model I have, I figure out that I have a property with prefix 'new'. I will fix it,thanks. Except 'new', is there any other prefix can not be used?
Names starting with alloc, new, copy, mutableCopy are disallowed if followed by a non-lowercase letter (or nothing).
@bdash ,I got it. Thanks for your help !
Do you have any other questions, @Jinkeycode?
I'm closing this ticket. If you have any more questions, feel free to file another one!
Most helpful comment
Names starting with
alloc,new,copy,mutableCopyare disallowed if followed by a non-lowercase letter (or nothing).