FROM : Michael Ash
DATE : Fri Jun 23 21:12:27 2006
On 6/23/06, D.K. Johnston <<email_removed>> wrote:
> I made a subclass of NSWindowController. It looks like this:
>
> @interface TextDisplayController : NSWindowController
> {
> IBOutlet id text;
> IBOutlet id citation;
> IBOutlet id title;
> }
> - (void)setText:(NSString *)textString;
> - (void)setCitation:(NSString *)citationString;
> - (void)setWorkTitle:(NSString *)titleString;
> @end
>
> I call the 'set' methods in this order:
>
> setWorkTitle:
> setCitation:
> setText:
>
> and then call the showWindow: method. To my surprise, the
> setCitation: and setText: methods are called again (in that order),
> but not the other. Of course, none of these should be called twice. I
> can't figure out why this is happening.
Cocoa thinks your set methods are accessors for your instance
variables, since they have the same names. Change the names so that it
no longer thinks that. See:
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSNib_Class/Reference/Reference.html
Mike
DATE : Fri Jun 23 21:12:27 2006
On 6/23/06, D.K. Johnston <<email_removed>> wrote:
> I made a subclass of NSWindowController. It looks like this:
>
> @interface TextDisplayController : NSWindowController
> {
> IBOutlet id text;
> IBOutlet id citation;
> IBOutlet id title;
> }
> - (void)setText:(NSString *)textString;
> - (void)setCitation:(NSString *)citationString;
> - (void)setWorkTitle:(NSString *)titleString;
> @end
>
> I call the 'set' methods in this order:
>
> setWorkTitle:
> setCitation:
> setText:
>
> and then call the showWindow: method. To my surprise, the
> setCitation: and setText: methods are called again (in that order),
> but not the other. Of course, none of these should be called twice. I
> can't figure out why this is happening.
Cocoa thinks your set methods are accessors for your instance
variables, since they have the same names. Change the names so that it
no longer thinks that. See:
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSNib_Class/Reference/Reference.html
Mike
| Related mails | Author | Date |
|---|---|---|
| D.K. Johnston | Jun 23, 20:51 | |
| Michael Ash | Jun 23, 21:12 |






Cocoa mail archive

