Multiple Documents, Core Data & NSFetchedResultsController
Hey, I’m stuck in a bit of a rut here… I have a macOS Document Based Application using Core Data. Each document has its own Managed Object Context as created from the template NSPersistentDocument and is injected into the variety of model managers that need it throughout the app. As a way of keeping track off all the changes and updating the UI I’m using NSFecthedResultsController and its delegate methods, particularly controller(_:didChange:at:for:newIndexPath:) All works beautifully when a single document is open in terms of creating, editing and deleting managed objects. The problem occurs when I have more than one document. After creating a new object within one document, no other documents NSFetchedResultsController is notified of the change when an object is made in theirs. I can confirm objects are being made with managedObjectContext.hasChanges And check they are indeed the correct object with managedObjectContext.insertedObjects And also interestingly when I add an observer for Notification.Name.NSManagedObjectContextObjectsDidChange I can log that change and see they are the correct object within the right context. But for some reason, NSFecthedResultsController is not… Would any of you have any clues I could chase down to figure this out. Many thanks for your help in advance. Sincerely Sam ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Can I generate a segue this way?
On Jun 6, 2018, at 11:14 PM, Rick Aurbach wrote: > Working with a storyboard, I add a Tap Gesture Recognizer, connect it to the > label, and connect the segue to the gesture recognizer. I think I've set > everything up correctly, but tapping on the label does not trigger the segue. You might need to verify that “user interaction” is enabled for the label (which, if I recall correctly, it is not by default). b (Hitting both lists huh? :)) ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Can I generate a segue this way?
I have a situation where I want a user tap on a UILabel to generate a segue. (Yes, it sounds a bit strange, but it makes sense in context.) Working with a storyboard, I add a Tap Gesture Recognizer, connect it to the label, and connect the segue to the gesture recognizer. I think I've set everything up correctly, but tapping on the label does not trigger the segue. Before I spend even more time double-checking my setup, I would like to ask if this is possible. I.e., should I be able to trigger a segue from a gesture recognizer? (IB lets me do it...) and if so, is my approach correct? I figure I ought to be able to do this programmatically, but working in the storyboard is just so much nicer... By the way (if this makes a difference), the segue is connected to a Storyboard Reference, rather than to a scene in the current storyboard. Could this be the problem? What do you think? Cheers, Rick Aurbach ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com