• 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: Accessing a property of a view via its controller doesn't work
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Accessing a property of a view via its controller doesn't work


  • Subject: Re: Accessing a property of a view via its controller doesn't work
  • From: Gabriel Zachmann via Cocoa-dev <email@hidden>
  • Date: Mon, 6 Sep 2021 23:03:58 +0200

Mystery solved - it was, of course, a stupid bug on my part.

Just in case somebody else stumbles across this thread: I had forgotten a
@synthesize in the .m file.
(Xcode emits a warning about this, but I had overlooked it, due to several
other warnings always being there.)

Sorry for bothering you all.



> On 4. Sep 2021, at 20:06, Ben Kennedy <email@hidden> wrote:
>
>
>> On Sep 4, 2021, at 10:27 AM, Gabriel Zachmann via Cocoa-dev
>> <email@hidden> wrote:
>>
>> I access the window of a view by two different ways, in the controller and
>> in the view, resp., and in the controller, I always get a nil pointer.
>>
>> In my app, I have a subclass of NSView, MyView, declared like this:
>>
>> @interface MyView : NSView <NSTextViewDelegate, CALayerDelegate,
>> CAAnimationDelegate>
>> {
>>   NSWindow * window_;
>>   ...
>> }
>> @property (readwrite) NSWindow * window_;
>
> What’s the purpose of this? NSView already has a `window` property that
> returns its parent window. Why not just use that?
>
> -ben
>
> Sent from my iPhone

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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

  • Follow-Ups:
    • Re: Accessing a property of a view via its controller doesn't work
      • From: Alex Zavatone via Cocoa-dev <email@hidden>
References: 
 >Accessing a property of a view via its controller doesn't work (From: Gabriel Zachmann via Cocoa-dev <email@hidden>)
 >Re: Accessing a property of a view via its controller doesn't work (From: Ben Kennedy via Cocoa-dev <email@hidden>)

  • Prev by Date: Re: Accessing a property of a view via its controller doesn't work
  • Next by Date: Re: Accessing a property of a view via its controller doesn't work
  • Previous by thread: Re: Accessing a property of a view via its controller doesn't work
  • Next by thread: Re: Accessing a property of a view via its controller doesn't work
  • Index(es):
    • Date
    • Thread