• 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: Connecting a button to MyView zeros integers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Connecting a button to MyView zeros integers


  • Subject: Re: Connecting a button to MyView zeros integers
  • From: Roland King <email@hidden>
  • Date: Sat, 14 Feb 2015 10:25:31 +0800

> On 14 Feb 2015, at 01:16, Kyle Sluder <email@hidden> wrote:
>
> On Fri, Feb 13, 2015, at 10:42 AM, David Duncan wrote:
>> Since you elided your header file, this begs a question – is this iOS or
>> OS X?
>>
>> If I’m not mistaken, subclasses of NSView do not get -initWithCoder:, but
>> rather -initWithFrame:, which begs the question of have you confirmed
>> that your -initWithCoder: method is being called?
>
> This depends on whether the "prefer coder" checkbox was checked when the
> XIB was authored. If that checkbox is checked, instantiation behaves
> like iOS, where custom views get -initWithCoder: instead of
> -initWithFrame:.
>

From the fact in the original message that the two variables remained at the default of zero my assumption was that neither piece of advice from the previous thread on this was followed, those being :-

1) Leave the 'prefer coder' checkbox checked, because it's more consistent, arguably fixes a longstanding bug, and remembering when you've turned it on and off is likely to lead to confusion.
2) Don't put initialisation code directly in initWithCoder: but factor it out to a separate method called from all the init routines, so it doesn't matter which one is called, they all funnel through the same setup code.


_______________________________________________

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: 
 >Connecting a button to MyView zeros integers (From: N!K <email@hidden>)
 >Re: Connecting a button to MyView zeros integers (From: David Duncan <email@hidden>)
 >Re: Connecting a button to MyView zeros integers (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Re: Human-understandable process name
  • Next by Date: Re: WKWebView + <input type="file">
  • Previous by thread: Re: Connecting a button to MyView zeros integers
  • Next by thread: Re: Connecting a button to MyView zeros integers
  • Index(es):
    • Date
    • Thread