Search code examples
objective-ccappuccinoobjective-j

Understanding methods syntax in Objective-C and Objective-J


I've a simple question about objective-c / objective-j syntax.

This is a method dataForItemsAtIndexes and it gets as parameters a CPIndextSet and CPString. It should return a CPData object. However I don't understand what's (CPCollectionView)aCollectionView.

- (CPData)collectionView:(CPCollectionView)aCollectionView
   dataForItemsAtIndexes:(CPIndexSet)indices
                 forType:(CPString)aType

Thanks


Solution

  • That identifies the CPCollectionView which your implementing data source corresponds to. This is useful in case your view or window has multiple CPCollectionViews, whose data sources are the same object, so it knows which view to provide which data to.