• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Cocoa Asynchronous API Design
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocoa Asynchronous API Design


  • Subject: Re: Cocoa Asynchronous API Design
  • From: Tito Ciuro <email@hidden>
  • Date: Tue, 24 May 2011 11:05:44 -0700

Hi Seth,

I thought about adding blocks, but I would like to support older iPhones if possible. Blocks were introduced in iOS 4, correct?

Thanks,

-- Tito

On May 24, 2011, at 10:30 AM, Seth Willits wrote:

> On May 24, 2011, at 8:25 AM, Tito Ciuro wrote:
>
>> I have a question about Cocoa API design. I think I can give a concrete example to best explain what the goal is. Assume I have an Inventory service and I need to write a client API that deals with it. Goals:
>>
>> - The API should allow me to add, update, delete and search items
>> - These operations should be asynchronous
>
>
> - (void)addInventoryItem:(Item *)item resultHandler:(void (^)(NSError * error))resultHandler;
>
> In this way, the result handling block already has access to every parameter and the receiver, so there's no need for verbose delegate methods which pass them all back, or packing and and unpacking an object which contains them all.
>
>
> --
> Seth Willits
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Cocoa Asynchronous API Design
      • From: Seth Willits <email@hidden>
    • Re: Cocoa Asynchronous API Design
      • From: Pablo Pons Bordes <email@hidden>
References: 
 >Cocoa Asynchronous API Design (From: Tito Ciuro <email@hidden>)
 >Re: Cocoa Asynchronous API Design (From: Seth Willits <email@hidden>)

  • Prev by Date: Creating system security enhancements
  • Next by Date: Re: How to force launch of new instance of application?
  • Previous by thread: Re: Cocoa Asynchronous API Design
  • Next by thread: Re: Cocoa Asynchronous API Design
  • Index(es):
    • Date
    • Thread