Re: for Loop Error or Logical Error?
Re: for Loop Error or Logical Error?
- Subject: Re: for Loop Error or Logical Error?
- From: Andrew Farmer <email@hidden>
- Date: Sat, 23 Dec 2006 14:03:25 -0800
On 23 Dec 06, at 12:23, Matthew Callis wrote:
I have a loop that is going through an array of sorted items and
making a
list of the unique items while counting the instances of them. The
error
occurs in that the last unique set of items in the array is not being
counted or listed, even though It IS in the array. The output
should have 3
items, not 2.
<snip>
Logical error. Walk through your code by hand and you'll see what's
going on.
By the way, you've improved things a bit since I last saw this code,
but you really ought to implement a few extra methods on the tape
object:
- (NSComparisonResult) compare:(Tape *)otherTape;
- (NSString *) tabDelimitedDescription;
Writing and using these properly should make this method a lot easier
to read and debug.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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