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

  • Home
  • SEARCH
  • 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 7725945
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T05:05:06+00:00 2026-06-01T05:05:06+00:00

I’m guessing there is a simple solution here, but I’ve tried some things and

  • 0

I’m guessing there is a simple solution here, but I’ve tried some things and nothing seems to work out. What I’d like to do is be able to iterate through the stored values in a model so I can present them in different ways graphically.

I can access the web service and store the data perfectly. As part of a larger model, I have a goals model with various goals that can be set.

GoalsModel looks like

@class RoundGoalsModel;

@interface RoundGoalsModel : NSObject {

    NSNumber* _scoreGoal;
    NSNumber* _parsGoal;
    NSNumber* _birdiesGoal;
}

@property (nonatomic, retain) NSNumber* scoreGoal;
@property (nonatomic, retain) NSNumber* parsGoal;
@property (nonatomic, retain) NSNumber* birdiesGoal;

@end

All the data is in there as expected. Now all I need to do is figure out how to loop through the keys and values in the Model so I can do things like present different icons for different goals, check if a value is null, etc. I’m trying to avoid having to access each individually with a bunch of conditional statements.

I’ve tried casting it to an array and other things that dont seem to work. Any advice or suggestions pointing me in the right direction would be awesome. Thanks!

  • 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-01T05:05:07+00:00Added an answer on June 1, 2026 at 5:05 am

    Your problem isn’t a RestKit problem it’s just an issue with your design. Since you already have your data placed into the individual fields you could just add a new field to return them in an array.

    .h

    @property(readonly, retain)NSDictionary *allProperties;
    

    .m

    @synthesize allProperties;
    
    - (NSDictionary*)allProperties
    {
       return [NSDictionary dictionaryWithObjectsAndKeys: _scoreGoal, @"scoreGoal", _parsGoal, @"parsGoal", _birdiesGoal, @"birdiesGoal", nil];
    }
    

    Then you could easily iterate over the dictionary and do whatever you want.

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string
I've got a string that has curly quotes in it. I'd like to replace

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.