Please do not post the same thing multiple times. The board software automatically flags certain posts as needing moderator attention. This happens the most often for new users. I'm pretty sure this is made clear at the time you attempt to post. Posting the same thing over and over again just makes that many more posts the moderators have to weed through later. This makes us sad. Don't make us sad. If your post/thread doesn't appear, just wait a while. Don't post it again. If it hasn't shown up by the next day, then you can try again. I normally go through posts in the mornings, and try to check a few times throughout the day, but I'm not here 24/7. There will typically be a significant delay before posts are approved. Just be patient.
You could do this. Create a mutable set, then iterate through the array, for each item of the array try to retrieve the value for key, by using the array item as the key. If it returns nil it means your seeing that item for the first time, so add an object to the array with that key and 1 as value. If it doesn't return nil you've had that value before so take the value, increment it by one and add it back to the set. At the end you'll have a set where keys are your numbers and their values are how many times they occurred in the array.
You could also sort the array then iterate through it counting while the items are the same then displaying the result when it changes and so on.
Replies
You could also sort the array then iterate through it counting while the items are the same then displaying the result when it changes and so on.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeSlickShopper 2 | BTIConcepts on GitHub | Free NSLog utility | Free Getter Utility | Leave a PayPal donation.
Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeNew app - See screenshots and details at www.globaclock.com.
If you want to
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like AwesomeMaybe, I will try to use your suggestions later for a more efficient way to count. Thanks again :)
Adalbert sagt.. (Germany only)
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Disagree Dislike Like Awesome