I'm confused regarding the following code and was hoping someone can help to clarify:
static NSArray *pointSizes = nil;
static dispatch_once_t onceToken;
pointSizes = @[@9,
Further in the code, inside the "cellForRowAtIndexPath" data source method, the array returned by the above is later accessed as if it were a property, like this:
But how is that so? Wouldn't you first have to invoke the method and store the output into a variable before accessing it in this manner? I know that you can access class properties using dot referencing, but this appears to be accessing the static variable inside the function since it is passing the index to the array object of the item in question. And without explicitly invoking the method first, how would the static variable ever be initialized in the first place?
It's probably some subtle thing that I'm missing here, but I could use some clarity if anyone can provide it.