I am develop a Document-based cocoa app use coredata,I bind NSViewController to NSArrayController like this :
https://developer.apple.com/library/archive/qa/qa1871/_index.html ,
,when I save some NSManagedObject in a document and then read data from the saved document,the models can read from the saved document,but the NSViewController be create many times,For example,if I saved 7 NSManagedObject in document,and then I open the saved document,I can get the saved 7 NSManagedObject,but the NSViewController will create 7 times,what should I do? thanks
I solved it, because my FUEAttributeVCBaseModelMO class has a attribute "@NSManaged public var owner: FUEAttributeViewController?",when I reopen the existed document,If the document has FUEAttributeVCBaseModelMOs,the object of FUEAttributeVCBaseModelMO will call the FUEAttributeViewController init.