Re: NSWindowController and nib in framework
Re: NSWindowController and nib in framework
- Subject: Re: NSWindowController and nib in framework
- From: Mike Abdullah <email@hidden>
- Date: Wed, 26 Sep 2012 20:18:59 +0100
On 26 Sep 2012, at 17:37, Quincey Morris <email@hidden> wrote:
> On Sep 25, 2012, at 22:37 , Graham Cox <email@hidden> wrote:
>
>> Is the app sandboxed?
>>
>> I ask because I've had reports of this same error from the odd user but have been unable to reproduce it so far. It's ONLY happening since we sandboxed though.
>
> No, the app has been around for a while and isn't sandboxed or code signed. It's possible, though, that the error only started happening after sandboxing was introduced, perhaps reflecting an implementation change in Cocoa frameworks.
>
> There's another similar error that occurred some months ago where a view controller init in the same private framework failed:
>
> self = [super initWithNibName: @"MyNib" bundle: [NSBundle bundleForClass: [self class]]];
It's worth noting that [self class] is a little bit dangerous here. If the instance happens to be a subclass of your class, you'll get back a different class and so search in the wrong bundle. Despite it feeling less clean, better to do:
self = [super initWithNibName:@"MyNib" bundle:[NSBundle bundleForClass: [MyClass class]]];
_______________________________________________
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