• 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: for Loop Error or Logical Error?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: for Loop Error or Logical Error?
      • From: "Matthew Callis" <email@hidden>
References: 
 >for Loop Error or Logical Error? (From: "Matthew Callis" <email@hidden>)

  • Prev by Date: WebView viewing video files, how to save locally
  • Next by Date: Exception closing NSPersistentDocument with unsaved data
  • Previous by thread: for Loop Error or Logical Error?
  • Next by thread: Re: for Loop Error or Logical Error?
  • Index(es):
    • Date
    • Thread