10 Mar 2013, 10:24
Zaba_pragsmall

Hans Christian von Stockhausen (3 posts)

Hi,

great book. Thank you. I am reading it on Readmill so I am not sure what the actual page number is but the source section I am concerned with is entitled Concurrency/PRPFirstProjectTweeter04/PRPFirstProjectTweeter/PRPViewContoller.m

Shouldn’t the @[self reloadTweets]@ inside the block have the same thread problems (i.e. it might not be main) as is later discussed in 3.2. GCD?

Im surprised that it never (I tried 5 times) fails. According to the docs the completion handler block is not guaranteed to be called on any particular thread. Shouldn’t I also see crash reports of the form [..] Tried to obtain the web lock from a thread other than the main thread [..]? Am I just un/lucky?

Also, the view is only released when one clicks ‘Send’ rather than ‘Cancel’ but I see someone already added an errata comment for this.

Best regards, Hans

10 Mar 2013, 14:02
Zaba_pragsmall

Hans Christian von Stockhausen (3 posts)

Is it because we don’t try to edit instance members but just call @loadRequest@ and it handles the dispatch to the main thread’s queue for us?

[OT] If I changed the view property from nonatomic to atomic: would one still be faced by synchronization issues? I expect it would break all sorts of other conventions and hurt performance but would that work?

  You must be logged in to comment