Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 761707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T15:52:14+00:00 2026-05-14T15:52:14+00:00

My setup: I have a sqlite database from which I populate a NSMutableArray of

  • 0

My setup:

  • I have a sqlite database from which I populate a NSMutableArray of NSDictionary objects this is the DataSource for my NSTableView.
  • One of the columns holds “time”, the time is a float that holds seconds.
  • I would like to display the values in this column as minutes:seconds. For instance my data would be 123.4329387 I want to display 2:03 which I have no problem doing with a subclass of NSFormatter (or NSNumberFormatter) applied to my NSTextField in the column.
  • I have sorting set up by using the Table Column Attributes in IB, I just have the sort key set to “time” and the selector set to “compare:” which works fine without the formatter.

Currently this gives me something like this when I sort (descending)

1:37, 1:31, 0:10, 0:10, 0:09, 1:30, 1:30, 1:26, 0:09

and similar nonsense, it looks like something is going on but it’s definitely not sorted.

How do I get the sort to look at the underlying data instead of the formatted value? Alternately, how do I specify a custom sort method and where do I put the code for said method? I have searched around quite a bit and have not found anything to help me out with this problem, any help with this is most appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T15:52:14+00:00Added an answer on May 14, 2026 at 3:52 pm

    It turns out that when it was sorting it was using compare: from the NSString class but it was using the underlying numeric data. I’m not exactly sure what all is going on under the hood here but I managed to fix this by creating my own compare method in a category of NSString called “timeCompare”. Then in interface builder I just put “timeCompare:” in the selector field for the the table column. This gets it to call my custom compare method from which I just converted the strings given to NSNumbers and call compare: on them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 495k
  • Answers 495k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer $(function(){ $("input").focus(); $('html, body').animate({scrollTop:0}, 'slow'); });) May 16, 2026 at 11:13 am
  • Editorial Team
    Editorial Team added an answer I got the issue... Actually, i was not allocating memory… May 16, 2026 at 11:13 am
  • Editorial Team
    Editorial Team added an answer I found the issue earlier in my CSS I had… May 16, 2026 at 11:13 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have a datalogging application (c#/.net) that logs data to a SQLite database. This
I have setup my site with 5 pages which are my menu options. When
I have a Setup project (MSI) in VS2008 which installs my project. Within the
I have the following function in my iPhone project which works great...unless the query
I'm trying to set up a simple SQLite database in Android, handling the schema
I have setup a custom managed property in MOSS and mapped it to a
I have this problem and it's drivin' me nuts! So I am developing my
Have following setup: MainActivity class - extends activity MyLayout class - extends View Prefs
I am working on releasing an app that will greatly benefit from using the
Looking for some syntax help for SQLite, a very odd thing is happening. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.