Re: NSViewController -identifier unrecognized selecto problem
Re: NSViewController -identifier unrecognized selecto problem
- Subject: Re: NSViewController -identifier unrecognized selecto problem
- From: Quincey Morris <email@hidden>
- Date: Wed, 09 Dec 2015 09:54:30 -0800
- Feedback-id: 167118m:167118agrif8a:167118sfWjsnXTfT:SMTPCORP
On Dec 9, 2015, at 09:20 , Jonathan Mitchell <email@hidden> wrote:
>
> On 10.9 I get
>
> 'NSInvalidArgumentException', reason: '-[TSToolbarGroup identifier]: unrecognized selector sent to instance 0x60000018ee10’
You get this … when? When the NIB is loaded?
> TSToolbarGroup is an NSViewController subclass of mine
>
> How can this be?
> I didn’t have this issue when I built against 10.9 rather than 10.11.
Are you using a XIB or a storyboard? My guess is that you’re using a XIB and its IB “Builds for” setting is not set to “Project deployment target”.
> Curiously the header for NSViewController on 10.11 doesn’t define any identifier accessors.
It doesn’t need to do so there, because it conforms to the protocol that requires it. All it needs is to have an implementation.
The only real mystery is why it doesn’t have the implementation under 10.9. It’s possible that the implementation is added at runtime, depending on which OS X version it’s running under, which is why the “Builds for” setting might matter.
> When building solely for 10.9 I used to declare an identifier property on my view controller subclasses (obviously with good reason, though why I thought this was necessary I don’t know now)
> @property (strong) NSString *identifier;
> But Xcode 7 moans about property synthesis when this is present.
You don’t say what the error is, but presumably it’s complaining that the property attributes don’t match the protocol.
_______________________________________________
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