I saw some code on the apple website that goes like this
id <NSFetchedResultsSectionInfo> sectionInfo = ...
How is this different to the following?
NSFetchedResultsSectionInfo *sectionInfo = ...
I'm not so interested in NSFetchedResultsSectionInfo itself, but rather the way it's declared.
Thanks a bunch!
Tristan
NSFetchedResultsSectionInfo
is a protocol. id is a way of declaring a generic object, and id <NSFetchedResultsSectionInfo>
declares a generic object that must adhere to the NSFetchedResultsSectionInfo
protocol.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With