• 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
Calling subclassed methods on Cocoa objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Calling subclassed methods on Cocoa objects
      • From: Larry Fransson <email@hidden>
    • Re: Calling subclassed methods on Cocoa objects
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: source code
  • Next by Date: Re: source code
  • Previous by thread: Re: source code
  • Next by thread: Re: Calling subclassed methods on Cocoa objects
  • Index(es):
    • Date
    • Thread