in the Stack Overflow posting:
Alan asked how to create a global UIManagedDocument
to be used throughout his entire app. He provided code slices of his attempt. Kevinpo provided an answer which made perfect sense to Alan.
But I started out with the same problem, and can't make heads or tails out of their collective postings.
Specifically:
managedDocumentDictionary
,
but does not explain how to create it so I get an 'undeclared
identifier' compilation error.UIManagedDocument
, yet throughout both his and Kevin's
code, neither actually show defining a helper method with .h and .m
files.So, if possible, can anyone make sense of what they are saying and help me understand how it all fits together? Perhaps:
UIManagedDocument
,Thanks to all for any interpretations you can offer.
That post shows how to access a document, based on a name. The dictionary is a mapping from names to UIManagedDocument instances. Thus, he can ask for document @"Foo" and the code will go look up @"Foo" in the dictionary. If it is there, the UIManagedDocument will be returned. If it is not there, then a new one will be created and placed in the dictionary (and the passed-in completion block will be called).
His question was basically, how to pass a completion block to the function, and have that function call the completion block he passed in.