• 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: What difference exist from where a method will be called?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What difference exist from where a method will be called?


  • Subject: Re: What difference exist from where a method will be called?
  • From: Raimond Hettrich <email@hidden>
  • Date: Thu, 08 Sep 2016 16:21:10 +0200

Oh man, You got it! That’s the solution.

I study as conscionable as I can, but until now I thought an object in the nib is just a connection to the class, but now I'm feeling very silly because it’s obvious that it is an object and if the object is named like a existing class it’s just another instance of it.

Thank You very much for Your time and Your knowledge!
Raimond




> Am 08.09.2016 um 16:01 schrieb Graham Cox <email@hidden>:
>
>
>> On 8 Sep 2016, at 11:13 PM, Raimond Hettrich <email@hidden> wrote:
>>
>> the init-method of the DelegateClass is running. This is because I have a class object in the Document.xib file
>
>
> Alarm bells. What exactly does this mean?
>
> I assume you mean you have a custom view within the document’s window, and you’ve set its class to ‘DelegateClass’. That is the normal way to add NSView subclasses in a xib. Depending on the ‘Prefer Coder’ checkbox for the xib, the -initWithFrame: or -initWithCoder: methods will be called. I don’t see that -init will ever be called. The only way to be sure is to set a debugger breakpoint in the -init method.
>
> If you’ve added an object to the xib and set its class to ‘DelegateClass’ as well as having a view in the window, you’ll have two of them. One is on screen and is reporting from its -drawRect method, the other is the one that’s responding to the button and showing its array. If that’s the case, its -init method WILL be called, because it’s being treated as a plain object, not an NSView.
>
> From what you’ve described, this would fit the logging output you’re seeing, but because you haven’t logged the identity of the view itself, you haven’t seen that there are two. A breakpoint would reveal that, because you can see the address of the object.
>
> —Graham
>
>


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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


References: 
 >What difference exist from where a method will be called? (From: Raimond Hettrich <email@hidden>)
 >Re: What difference exist from where a method will be called? (From: Jens Alfke <email@hidden>)
 >Re: What difference exist from where a method will be called? (From: Raimond Hettrich <email@hidden>)
 >Re: What difference exist from where a method will be called? (From: Graham Cox <email@hidden>)
 >Re: What difference exist from where a method will be called? (From: Raimond Hettrich <email@hidden>)
 >Re: What difference exist from where a method will be called? (From: Graham Cox <email@hidden>)

  • Prev by Date: Re: What difference exist from where a method will be called?
  • Next by Date: More Provisioning woes
  • Previous by thread: Re: What difference exist from where a method will be called?
  • Next by thread: Re: What difference exist from where a method will be called?
  • Index(es):
    • Date
    • Thread