• 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: bindings duplicates object returned
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: bindings duplicates object returned


  • Subject: Re: bindings duplicates object returned
  • From: Kyle Sluder <email@hidden>
  • Date: Tue, 13 Dec 2011 10:47:19 -0800

On Tue, Dec 13, 2011 at 10:04 AM, Eric Slosser <email@hidden> wrote:
> I found the solution, and it's all my fault.
>
> The object 'foo' was meant to be a singleton instance of class 'Foo'.  I always access it through [foo instance], which enforces that.  After 'foo' is created, the nib is loaded in which the binding was expressed.  In the process (see stack below**), -[Foo init] is called.  My override of -[Foo init] didn't have singleton smarts, so I happily handed a different m_contents to the controller.

Don't be tempted to add singleton smarts to -[Foo init]. ARC will not
like them. Instead, add a property to File's Owner that just returns
the shared Foo instance.

--Kyle Sluder
_______________________________________________

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: bindings duplicates object returned
      • From: Eric Slosser <email@hidden>
References: 
 >bindings duplicates object returned (From: Eric Slosser <email@hidden>)
 >Re: bindings duplicates object returned (From: Quincey Morris <email@hidden>)
 >Re: bindings duplicates object returned (From: Eric Slosser <email@hidden>)
 >Re: bindings duplicates object returned (From: Eric Slosser <email@hidden>)

  • Prev by Date: is there some disadvantage to predicateWithBlock?
  • Next by Date: Re: bindings duplicates object returned
  • Previous by thread: Re: bindings duplicates object returned
  • Next by thread: Re: bindings duplicates object returned
  • Index(es):
    • Date
    • Thread