• 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
Re: Overriding NSTextField problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Overriding NSTextField problem


  • Subject: Re: Overriding NSTextField problem
  • From: email@hidden
  • Date: Mon, 25 Feb 2002 11:43:04 -0800

Yes, just after sending my mail, I went back to the doc and changed my
init to:

- (id)initWithFrame:(NSRect)frameRect{
if (self = [super initWithFrame:frameRect]){
[self registerForDraggedTypes:[NSArray
arrayWithObject:NSStringPboardType]];
NSLog(@"J ai changi de nature");
}
NSLog (@"Tiens un log");
return self;
}

Unfortunately, I get the same 'no log', and my drag & drop doesn't work,
of course. I guess it is more related to my use of IB etc. That's why I
really don't get it.

I don't recall seeing a response to this part, so here goes.
I believe -initWithCoder: is called in the nib-instantiation case. It may also be a designated initializer -- i.e. it may call no other init method on self, only on super. I'm am not certain of this, and couldn't find anything one way or the other in a very quick scan of the doc, but it the other init methods don't seem to get called, I'd try initWithCoder:.

By the way, overriding init should work (it' an
object isn't it), NSviews have to call init method some day?

I believe others answered this; the key is the concept of the designated initializer(s) for a class, which do not need to be the same as super's designated initializer(s).

Ben Haller
Stick Software
_______________________________________________
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.

  • Prev by Date: Re: HTMLDisplay.framework == HTMLRendering?
  • Next by Date: Re: complex problem
  • Previous by thread: Re: Overriding NSTextField problem
  • Next by thread: Hanging on validateMenuItem when a document is minimized
  • Index(es):
    • Date
    • Thread