• 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: What is the expected Cocoa API behavior in an incomplete object traversal?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is the expected Cocoa API behavior in an incomplete object traversal?


  • Subject: Re: What is the expected Cocoa API behavior in an incomplete object traversal?
  • From: Tito Ciuro <email@hidden>
  • Date: Fri, 15 Oct 2010 17:30:46 -0300

Hi Corbin,

On 15/10/2010, at 16:55, Corbin Dunn wrote:

>  If it is instead some array input that the user provided, and it is a user error to provide the wrong input, then you should return a user-presentable NSError and the caller should present the error on failure.

This sounds right to me.

Well, in a normal situation the array would contain conforming objects. However, as it can happen once in a while, one can add an object to an array thinking it's of one type when in fact it's another. Currently, the method detects this anomaly and skips it while continuing traversing the array. It then fills an NSError (as long as the user cares) and returns NO. This is the method I'm talking about:

- (BOOL)addObjectsFromArray:(NSArray *)someObjects error:(out NSError **)outError;

I wonder if returning a BOOL and filling out an NSError is a bit too much though...

Thanks to everyone who have responded,

-- Tito
_______________________________________________

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: What is the expected Cocoa API behavior in an incomplete object traversal?
      • From: Martin Wierschin <email@hidden>
References: 
 >What is the expected Cocoa API behavior in an incomplete object traversal? (From: Tito Ciuro <email@hidden>)
 >Re: What is the expected Cocoa API behavior in an incomplete object traversal? (From: Corbin Dunn <email@hidden>)

  • Prev by Date: Re: What is the expected Cocoa API behavior in an incomplete object traversal?
  • Next by Date: Re: NSScanner Failing with EXC_BAD_ACCESS
  • Previous by thread: Re: What is the expected Cocoa API behavior in an incomplete object traversal?
  • Next by thread: Re: What is the expected Cocoa API behavior in an incomplete object traversal?
  • Index(es):
    • Date
    • Thread