• 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
Nib unloading and ARC
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Nib unloading and ARC


  • Subject: Nib unloading and ARC
  • From: Jonathan Mitchell <email@hidden>
  • Date: Mon, 15 Sep 2014 23:00:27 +0100

I am using a NIB template, loading the same nib repetitively with a different owner each time (a non NSViewController subclass).
In the nib there is an NSValueBinding binding to the owner say: self.itemValue.
This all works fine.

However, nib owner items are not being dealloc’d.
This behaviour only occurs if the nib contains a binding to self.

Keary Suska has been down this route pre ARC : http://www.cocoabuilder.com/archive/cocoa/181029-proper-way-to-unload-loaded-nib-bindings.html

Nib top level objects seem to have an extra retain.
The docs recommend the following [topLevelObjs makeObjectsPerformSelector:@selector(release)];
https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/10000051i-CH4-SW8

However I haven’t been able to get this explicit release approach to work under ARC.
Just calling CFRelease((__bridge CFTypeRef)(item)) on each of the top level objects doesn’t work.

Or should I refactor to make each NIB owner an NSViewController instance?

Thanks

Jonathan






_______________________________________________

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: Nib unloading and ARC
      • From: Ken Thomases <email@hidden>
  • Prev by Date: Re: Want NSTableView NSOutlineView to load lazy like iOS?
  • Next by Date: Re: Nib unloading and ARC
  • Previous by thread: Re: Binding Exception
  • Next by thread: Re: Nib unloading and ARC
  • Index(es):
    • Date
    • Thread