Calling subclassed methods on Cocoa objects
Calling subclassed methods on Cocoa objects
- Subject: Calling subclassed methods on Cocoa objects
- From: "David Piasecki" <email@hidden>
- Date: Wed, 14 Apr 2004 11:38:20 -0700
I subclassed NSImageView to a class MyImageView. I placed a NSImageView
object on my main window and filled it with a picture. So I've got an
image displayed in the object in Interface Builder. Now I want certain
customizations by calling methods in MyImageView. So I went to the
"Custom Class" option and selected MyImageView for the class type. Then
I created a method in MyImageView called SetObject which provides a
reference to a newly created object in MyController that I also want to
access in MyImageView. In the init method of MyController, I call
SetObject; however, when I debug the application, it seems that
SetObject never gets called. Perhaps MyController needs to be
initialized before I do any operations on its objects? How else might I
have both MyController and MyImageView reference the same object?
- (void)init
{
[myimage SetObject:sharedObject];
}
David
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.