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 8601587
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:52:42+00:00 2026-06-12T01:52:42+00:00

Got a tableView with some player objects in it, sorted ASC by best playerTime

  • 0

Got a tableView with some player objects in it, sorted ASC by best playerTime after each game try a player makes.

Now I want to add a value (int) that shows the players placement in the playerlist (tableview), that will be reflected on the the players custom cell in the tableView. Got the custom cell working already with the dynamic data, just I need the “placement” int.

How do I handle the array to do this? Must be done after the list (NSArray) been sorted by best playerTime.

  • I guess, some kind of iteration step one and two maybe (like an if-then statement)?
  • Maybe there is a smart NSArray property for this specific need?

Any tips or suggestions? Thank’s.

  • 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-06-12T01:52:44+00:00Added an answer on June 12, 2026 at 1:52 am

    Just display the row’s value into your custom cell’s label:

    - (UITableViewCell *)cellForRowAtIndexPath:(NSIndexPath *)indexPath{
        //...
        myCustomCell.positionLabel.text = [NSString stringWithFormat:@"%i", (indexPath.row + 1)];
        //...
    }
    

    Now if you have a player object and want to retrieve its position in your sorted array, you just do this:

    int playerPosition = [mySortedArray indexOfObject:playerObject] + 1;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm having some trouble here. I've got a tableview, with 7 cells, all of
I got an app with some text data. From TableView user choose one cell
I made a simple code for tableView to display some player data; however, I
I've got a tableview loaded from an array and for some reason it's re-using
I'm building an iphone app and I've got a table view with some textfields
I've got an NSSplitView and on the left side I've got a tableView (like
I got this error twice. it says error: redefinition of '-[SampleTableViewController tableView:cellForRowAtIndexPath:]'
I got more of a general question. Instead of a tableview I have a
Got a programm with 2 threads. one thread is writing some stuff into the
I've got the following code in one of my view controllers: - (void)tableView:(UITableView *)tableView

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.