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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T12:52:26+00:00 2026-05-13T12:52:26+00:00

I didn’t find anything similar to .NET PropertyGrid class in Cocoa, so I started

  • 0

I didn’t find anything similar to .NET PropertyGrid class in Cocoa, so I started to write my own version.
I use information from runtime to get properties of object:

Class reflectedClass = [reflectedObject class];
uint propertyCount = 0U;
objc_property_t *properties = class_copyPropertyList(reflectedClass, 
                                                     &propertyCount);

And this for getting/setting values in NSTableView:

- (NSString *)propertyNameAtIndex:(int)index
{
    return (NSString *)[cachedPropertyNames objectAtIndex:index];
}

- (id)propertyValueAtIndex:(int)index
{
    return [reflectedObject valueForKey:[self propertyNameAtIndex:index]];
}

- (void)setPropertyValue:(id)value atIndex:(int)index
{
    [reflectedObject setValue:value forKey:[self propertyNameAtIndex:index]];
}

For syncing updates with reflectedObject is used basic KVO:

[reflectedObject addObserver:self
                  forKeyPath:propertyName
                     options:NSKeyValueObservingOptionOld | 
                             NSKeyValueObservingOptionNew
                     context:NULL];

This solution works, but I have two problems that I need to fix:

  1. I need to simulate somehow .NET attributes, so I can choose right editor for property.
    Text boxes is not good for all situations.
  2. Different cell editor for each row, so for booleans checkboxes, for strings textboxes, etc.

I am still beginner in Cocoa so sorry if I am asking for something really basic.

UPDATE: I need something like this (picture from Xcode->Get Info->Build):

PropertyGridCocoa http://www.adorior.cz/Images/PropertyGridCocoa.png

  • 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-05-13T12:52:27+00:00Added an answer on May 13, 2026 at 12:52 pm

    Cocoa has no such view built in to the framework. If no-one else has created one and released it as open source, you will need to create one from the ground up.

    It’s probably easier to hand-craft a UI that matches the underlying model.

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

Sidebar

Related Questions

I didn't find information about performance issues with auto_ptr and shared_ptr (I use tr1
didn't find anything in related questions. Most probably it's super noob, but I'll ask
I didn't find any good documentation for getting started with the Ember.js. Please help
I didn't find anything about parsing HTML in the XML::LibXML::Reader documentation. And I tried
I didn't find a Example how to use a fluid partial in a extbase
I didn't find a similar question, so I apologize if it already exists. In
I didn't find an answer on the net and i hope this question have
I didn't find anything about that. Here's my query: SELECT p.*, pa.*, a.* FROM
Didn't find any from their website. I mostly just trying to see which one
I didn't find any solution that helped me on the older questions on SO...

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.