• 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
Implementing a record counter (record n of records)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Implementing a record counter (record n of records)


  • Subject: Implementing a record counter (record n of records)
  • From: "Jon C. Munson II" <email@hidden>
  • Date: Thu, 18 Dec 2008 14:50:59 -0500
  • Organization: JTA Enterprises LLC

Namaste!

I'm attempting to implement a simple record counter:

Record n of records

     n = current record number 

     records = total number of records

I've looked at the Events Manager sample and borrowed the text field from
there which has a representation of "# out #."  It uses the Value with
Pattern Bindings method:  %{value1}@ out of %{value2}@.  value1 =
someController.selection.@count, value2 =
someController.arrangedObjects.@count.

However, the first binding, Value1, is incorrect.  It holds the number of
records that are selected (most likely used in conjunction with a
tableView).  So, I changed it to selectedIndex instead of the binding it
had.  This, of course, yields a zero-based index value vs. count which is
1-based.  Then, the question after that is, what happens when there aren't
any objects?  selectionIndex is most likely going to be some number other
than 0 (and it is from my own testing).

Attempting my own move methods resulted in not being able to get an initial
count of records in the arrangedObjects (which can seemingly only be
retrieved through awakeFromNib, though arrangedObjects hasn't been retrieved
yet).

Thus my question:  what is the correct way to implement a record counter?
Or, what is the correct key value binding for Value1?

Thanks in advance!

Peace, Love, and Light,
 
/s/ Jon C. Munson II

_______________________________________________

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: Implementing a record counter (record n of records)
      • From: Kevin Gessner <email@hidden>
  • Prev by Date: Re: Preventing Automatic Gzip Decompression with NSURLConnection?
  • Next by Date: Question Regarding the Memory Address of Objects
  • Previous by thread: Re: does this crash make sense to anyone?
  • Next by thread: Re: Implementing a record counter (record n of records)
  • Index(es):
    • Date
    • Thread