• 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: loadNibNamed deprecated, but newer version crashes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: loadNibNamed deprecated, but newer version crashes


  • Subject: Re: loadNibNamed deprecated, but newer version crashes
  • From: Dave <email@hidden>
  • Date: Mon, 19 Sep 2016 13:23:44 +0100

Yeah, you need to either assign the Array to a strong property OR you need to extract what you want from the Array and store those items as a strong property.

Cheers
Dave

> On 19 Sep 2016, at 11:19, Alastair Houghton <email@hidden> wrote:
>
> On 19 Sep 2016, at 10:02, Gabriel Zachmann <email@hidden> wrote:
>>
>> Thanks a lot for your response.
>>
>> When I replace this line
>> 	[NSBundle loadNibNamed: @"ConfigureSheet" owner: self];
>> by this:
>> 	NSBundle * bundle = [NSBundle bundleForClass:[self class]];
>> 	[bundle loadNibNamed: @"ConfigureSheet" owner: self topLevelObjects: nil];
>>
>> then System preferences crashes with this stack trace:
>
> The problem is likely that you aren’t retaining all of the top level objects in the nib file, and something you’re relying on is being disposed of.  The simplest fix for older code that was using the original -loadNibNamed:owner: method is often just to add an NSArray member variable to your class to hold the top level object references.
>
> Kind regards,
>
> Alastair.
>
> --
> http://alastairs-place.net
>
>
> _______________________________________________
>
> 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


_______________________________________________

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: 
 >How to make Xcode launch a different app when "Running" my code? (From: Gabriel Zachmann <email@hidden>)
 >Re: How to make Xcode launch a different app when "Running" my code? (From: "Pascal J. Bourguignon" <email@hidden>)
 >loadNibNamed deprecated, but newer version crashes (From: Gabriel Zachmann <email@hidden>)
 >Re: loadNibNamed deprecated, but newer version crashes (From: Charles Srstka <email@hidden>)
 >Re: loadNibNamed deprecated, but newer version crashes (From: Gabriel Zachmann <email@hidden>)
 >Re: loadNibNamed deprecated, but newer version crashes (From: Alastair Houghton <email@hidden>)

  • Prev by Date: Re: loadNibNamed deprecated, but newer version crashes
  • Next by Date: Xcode-like title bar using title bar accessory view
  • Previous by thread: Re: loadNibNamed deprecated, but newer version crashes
  • Next by thread: Re: How to make Xcode launch a different app when "Running" my code?
  • Index(es):
    • Date
    • Thread