0

I need to know the source of the changed coredata objects returned from NSManagedObjectContextObjectsDidChange. I have some shared objects, and want to send a notification if the source is other than me. But when I change an object, it comes through the same as objects changed by other users. Is there any way to tell the difference?

0

1 Answer 1

0

I found a way to do this. Not as easy as I hoped, but not too bad. I fetch the CKRecord from CloudKit for the changed object, and it has a modifiedUser property that tells me if it was modified by me.

lastModifiedUserRecordID?.recordName == CKCurrentUserDefaultName

Sign up to request clarification or add additional context in comments.

2 Comments

But wouldn't the same user appear on all of a given user's devices?
Yes. Which is good, so I don't send a notification to myself no matter what device I'm on. I only want to send notifications when the change came from someone I've shared the object with.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.