• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Using custom NSController subclasses in IB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using custom NSController subclasses in IB


  • Subject: Using custom NSController subclasses in IB
  • From: Graham Davison <email@hidden>
  • Date: Thu, 10 May 2007 23:03:36 -0500

	From: 	  email@hidden
	Subject: 	Using custom NSController subclasses with IB
	Date: 	10 May 2007 22:08:06 CDT (CA)
	To: 	  email@hidden

Hi everyone.

I'm sure this is a newbie question, but I've been searching for quite a while for a answer to it.

I've created a subclass on NSController to essentially duplicate NSUserDefaultsController but using CFPreferences so that it can be used in a control panel. I want to use it in Interface Builder, but I can't instantiate it.

I've seen the instructions in the Interface Builder tips for creating subclasses, but the instruction there is to instantiate an NSController, then import the subclass, then set the class on the controller. The problem is, you can't instantiate a plain NSController.

Any ideas or suggestions? Am I missing something obvious?

Here's the interface for the class, in case it helps. PreferencesObjC is a (poorly named) ObjC wrapper for the CFPreferences.

@class PreferencesObjC;

@interface PreferencesController : NSController {
	// Modelled on NSUserDefaultsController
	@private
		PreferencesObjC*		_preferences;
		NSMutableDictionary*	_temporaryValues;
		id						_valueAccessor;
		struct __preferencesControllerFlags {
			unsigned int _appliesImmediately:1;
			unsigned int _reserved:31;
		} _preferencesControllerFlags;
}

- (id)initWithPreferences: (PreferencesObjC*)preferences;

- (PreferencesObjC*)preferences;	// KVO compliant

- (void)setAppliesImmediately: (BOOL)flag;   // default: YES
- (BOOL)appliesImmediately;			// KVO compliant

- (BOOL)hasUnappliedChanges;		// KVO compliant

- (id)values;	// KVO compliant

- (void)revert: (id)sender;
/*- (void)save: (id)sender;*/

@end


Thanks, Graham Davison _______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Prev by Date: scrollRangeToVisible
  • Next by Date: drag and drop problem.
  • Previous by thread: Re: scrollRangeToVisible
  • Next by thread: drag and drop problem.
  • Index(es):
    • Date
    • Thread