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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T14:47:44+00:00 2026-06-09T14:47:44+00:00

I’ve got a very simple problem, but the solution is proving very elusive. Here’s

  • 0

I’ve got a very simple problem, but the solution is proving very elusive.

Here’s what I have:

typedef { foo, bar, baz} EnumType;

@interface SomeObject: NSObject
@property EnumType someEnumValue;
@end

…and a view with an object_controller and an NSComboBox that should display the string name of the someEnumValue of the [object_controller selection] instance.

I realize that I can’t directly access the names of the enum values as strings. I’ve tried creating an NSArray holding the names of the enum values, and binding the ContentValues property to it – this loads the combo box with the property strings, but I can’t find any way to relate the enum value in the selected instance to the values in the combo box.

I’ve also tried using an NSValueTransformer to translate enum values to NSStrings and vice versa, but for the life of me, I can’t get it working: most of these attempts result in a thrown exception.

This trivial task has sucked about three hours out of my life. HELP! Thank you!

  • 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-09T14:47:46+00:00Added an answer on June 9, 2026 at 2:47 pm

    There are two approaches that I can think of to solve your problem.

    1. Load the array with strings in the same order as it is in your enum. Since you’ve got rest of the things working querying the NSComboBox for “indexOfSelectedItem” will give you the exact value of the enum. (Note: This works only if your enum starts from zero. Which I guess is the case while looking at your example.)

    2. Since you have created a class to hold the enum value. Add one more property to it which will hold the name of the enum.. Again query the NSComboBox for indexOfSelectedItem.You can now easily get the associated value by accessing object at given index from the arrangedObjects of arrayController that you are using to bind to the combo box.

    • 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
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a jquery bug and I've been looking for hours now, I can't
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,

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.