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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T01:12:39+00:00 2026-05-18T01:12:39+00:00

I am trying to create a preference pane which will reside within system preferences.

  • 0

I am trying to create a preference pane which will reside within system preferences. All the bindings are done as usual (for a normal windowed application), but when the setter for the binding property is called (data is updated), the table data does not reset. Are preference panes capable of updating table data via bindings? I have also tried to use a table data source unsuccessfully.

To clarify, I have an NSMutableArray property in my prefPane’s main class, an object representing the prefPane’s main class, and an arrayController in IB which is bound to the table column. in the init method of the prefPane’s main class, I set the value of the NSMutableArray, which is properly reflected in the pref pane, however, (just to test if bindings work), i have an NSTimer which resets the value of my NSMutable array when it finishes. A console message tells me that the value is properly reset, however, the changes are not reflected in the pref pane.

So in my current version i use the following code to set the properties to arbitrary values (simplified to try to get bindings to work at all). The property value is then reset by a timer 10 seconds later. Although the property is correctly updated (verified by console log), the pref pane does not reflect the changes in the tableview. Unfortunately, I cannot post screenshots of the bindings. I have an object in IB for the syncFrontEndPref class. I then have an arraycontroller bound to this object w/ a model key path of listArray. Then my table column is bound to the arraycontroller arranged objects. This loads properly with “test”, “test1”, “test2” in the pref pane (as populated from the init method). However, when repopulated from the timer, the changes are not reflected in the pref pane (although console log confirms listArray has indeed changed.

Here is the code:

@interface syncFrontEndPref : NSPreferencePane 
{

    NSMutableArray *listArray;
    NSNumber *syncInt;
    AuthenticateUser *newUser;
    NSMutableArray *syncIntervalList;
    IBOutlet NSTableView *theTableView;

}

@property (retain) NSMutableArray *listArray;
@property (retain) NSMutableArray *syncIntervalList;

- (void) mainViewDidLoad;
-(IBAction)syncIntervalValueChanged:(id)sender;
-(IBAction)tableViewSelected:(id)sender;



@implementation syncFrontEndPref

@synthesize listArray, syncIntervalList;

-(id) init{

    //populate nsarray w/ list data to display
    //[self setListArray: [NSMutableArray arrayWithArray:[[[NSDictionary dictionaryWithContentsOfFile:[GetFilePath pathForFile]] objectForKey:@"lists"] allObjects]]];
    [self setListArray: [NSMutableArray arrayWithObjects: @"test", @"test1", @"test2", nil]];

    //define values for drop-down sync interval selector
    [self setSyncIntervalList:[NSMutableArray arrayWithObjects: @"1 minute", @"5 minutes", @"10 minutes", @"30 minutes", @"24 hours", nil]];

    return self;

}

//code for the timer and selector method
- (void) mainViewDidLoad{
NSTimer *timer = [[NSTimer new] autorelease];
    int syncTime = 10;
    timer = [NSTimer scheduledTimerWithTimeInterval: syncTime target:self selector:@selector(targetMethod:) userInfo:nil repeats: YES];
}

-(void)targetMethod:(id)sender{

NSLog(@"running timer...");

[self setListArray: [NSMutableArray arrayWithObjects: @"0", @"1", @"2", nil]];
 NSLog(@"%@", listArray);   
}
  • 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-18T01:12:40+00:00Added an answer on May 18, 2026 at 1:12 am

    I think you have two instances of your syncFrontEndPref object instantiated.

    If you create a Preference Pane project from the template the File’s Owner will be the NSPreferencePane. If you’ve added another entry for the syncFrontEndPref object, you will be creating a second copy of the object, and mainViewDidLoad won’t be called in the second one. The timer won’t be triggered for that copy of the object and the listArray won’t be updated. Try adding a log statement to the init method. If you see that log statement run twice, you have two copies of the object.

    If you do have two copies of the object, I’d suggest removing the copy you added to the xib in IB. Change the class of the File’s Owner to your syncFrontEndPref class, and connect your bindings to that object.


    Does this look something like your current xib file in IB?

    alt text

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

Sidebar

Related Questions

I'm trying to create a preferences window. In it I have some checkbox style
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Trying to create a macro which can be used for print debug messages when
i'm trying to retrieve a value from my preference file which is an integer.
I'm trying to create Preference Screen with a Checkbox control. <CheckBoxPreference android:summaryOn=@string/mySummaryOn android:summaryOff=@string/mySummaryOff android:key=myCB
I am trying to create a dialog preference as follows <DialogPreference android:key=cachePref android:dialogMessage=Testing message
I am trying to create a preference screen for an Android project I'm developing.
I am getting the following error when trying to create a shared preferences file
I'm trying to create a custom layout for managing preferences. I know there is
I'm trying to create a loose word wrapping system via a regex in Perl.

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.