> On May 18, 2015, at 4:19 PM, Quincey Morris 
> <[email protected]> wrote:
> 
> IAC, at risk of offending Jens’s colleague, I’d say the real problem is that 
> specifying a mutable object as a property value is fraught with difficulties

It’s actually an API I created; he just ran into a crash involving it.

Generally I wouldn’t use a mutable property value, but in this case the class 
itself represents a temporary mutation of state: CBLRevision is an immutable 
saved revision, while CBLUnsavedRevision is a revision being updated in memory 
prior to being saved. The payload of a revision is its JSON properties, so it 
makes sense for CBLUnsavedRevision to expose these as an NSMutableDictionary, 
so the caller can change them in place instead of having to get the dictionary, 
mutableCopy it, mutate the copy, and then set it back. It makes a simple 
document update much simpler to write.

Anyway, it seems the simple solution is to implement the -setProperties: method 
by hand so it can call -mutableCopy. Problem solved.

—Jens
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Objc-language mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/objc-language/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to