Categories
Iphone Developer

Presence3:NSThread & NSOperation

Im looking through Presence3, understand the LetsMakeAThread project, its pretty straight forward, detachNewThread creates a separate thread and performSelectorOnMainThread returns you to the MT, but in ThreadedFlickrTableView, whats the deal?

beginLoadingFlickrData calls a new invocation operation, which loads synchronousLoadFlickrData: which gets the data from Flickr and returns to MT via didFinishLoadingFlickrDataWithResults: which in turn creates the arrays from the FlickrData.

Then cachedImageForURL gets called from the cellForRowAtIndexPath?  And so that same method calls the ImageLoadingOperation which then returns to the main thread via didFinishLoadingImageWithResult:?

Is this chronology correct?  The MT gets separated or stopped 2x in this app? Once in beginLoadingFlickrData and then in cachedImageForURL?  The difference being that in the former, it gets called out as simply a new method within the same file whereas in the latter it gets called as a completely new class file? I guess they did it to exemplify both cases?

Categories
Iphone Developer

Stanford Assignment 3 HelloPoly: 1 Control/Multiple Actions

I should have known this from my experience in Flash!  The solution to why it only draws the first polygon is that the same buttons, Increase and Decrease, required multiple, in this case 2, actions, not just one.  Basically you need to define another method, inside the polygonview, which calls setNeedsDispaly.  And hook up the same buttons in the nib file to that method.