What does creating an object with: id <class> instanceName mean?
I saw code on the Apple website that looks like this
id <NSFetchedResultsSectionInfo> sectionInfo = ... How is this different from the following?
NSFetchedResultsSectionInfo *sectionInfo = ... I'm not interested in NSFetchedResultsSectionInfo itself, but in the way it is declared.
Thanks a bunch!
Tristan
+4
2 answers
This syntax is used to indicate that the referencing object conforms to a particular protocol. See Apple's documentation on this aspect of Objective-C, specifically the Protocol Compliance section below.
+3