Still fairly new here to iOS and Objective-C programming, so looking for some advice to help keep me from going down the wrong road(s)... I would like to build an Objective-C class or classes to perform a file upload using a non-standard protocol. It would run the upload asynchronously and would need to notify the caller upon completion. I see a variety of techniques used or discussed for this and I was hoping to get some advice on which pattern or patterns I should use and which I should stay away from. I have no issue with using stuff that only runs on the latest iOS or OS X systems, so supporting older OS's in not a concern for me.
I see in particular: 1. delegates - e.g., NSURLConnection connection:didFailWithError: and connectionDidFinishLoading:, or similar ones in ASIHTTPRequest requestFinished or requestFailed 2. blocks - e.g., ASIURLRequest completionBlock or failedBlock, or ALAssetsLibrary assetForURL:resultBlock:failureBlock: (ASIHTTPRequest actually implements delegates and blocks and allows you to mix and match them.) 3. KVO (key-value observation) - e.g., some service where you observe an isFinished property 4. Notifications (NSNotificationCenter, etc.) - haven't really seen this used much but a lot of people seem to talk about it as a good approach There are probably other techniques as well... For a new, modern API which approach or approaches should I use or not use? I suppose my main interest here is to use something that's flexible to the programmer that uses my API, and something that is conventional ion its approach so that the programmer is using something normal and not unusual. Thanks in advance for any counsel on this... Chris _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com