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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T18:12:57+00:00 2026-06-14T18:12:57+00:00

Possible Duplicate: Get an object attributes list in Objective-C I am trying to find

  • 0

Possible Duplicate:
Get an object attributes list in Objective-C

I am trying to find a way to iterate through all properties on an object and assign the first non empty property’s value to another variable. All these properties are string and i am trying to use isEqualToString:@”” to check each property manually before assigning the first non empty one to another variable. Is there a way to do this efficiently by iterating through each property instead of having if conditionals checking each property individually?

  • 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-14T18:12:58+00:00Added an answer on June 14, 2026 at 6:12 pm

    Giuseppe’s answer is good but it seems you don’t need to complicate yourself with that.

    If you say all propertys are strings, why not use an NSArray and ,using fast enumeration, check if the string is in the array , if not just add it. That way you don’t have a limit (in case you need to modify the project later).

    Also this could work even with different types of variables/propertys. When you loop through the array just use isSubclassOfClass: to check type.

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

Sidebar

Related Questions

Possible Duplicate: List selectors for obj-c object Does anybody know how to get all
Possible Duplicate: best way to get the key of a key/value javascript object foo
Possible Duplicate: Loop through JavaScript object Get array of object’s keys Is there a
Possible Duplicate: Get list of all input objects using JavaScript, without accessing a form
Possible Duplicate: Objective C Introspection/Reflection I am looking for the way to get the
Possible Duplicate: Inspect python class attributes I need to get a clean list of
Possible Duplicate: PHP get values from SimpleXMLElement array SimpleXMLElement Object ( [@attributes] => Array
Possible Duplicate: Python: Get object by id Typically when you see the string representation
Possible Duplicate: What are the reasons why Map.get(Object key) is not (fully) generic According
Possible Duplicate: PHP ToString() equivalent I get this error: Catchable fatal error: Object of

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.