[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to compile for NSTextViewDelegate
From: |
Abhi Beckert |
Subject: |
Re: How to compile for NSTextViewDelegate |
Date: |
Thu, 28 Feb 2013 12:26:10 +1000 |
> However when I try to add the <NSTextViewDelegate> to my controller class I
> get a build error saying that NSTextViewDelegate is not found.
Objective-C has "formal" protocols and "informal" protocols.
The <NSTextViewDelegate> syntax only works if it is a formal protocol. For
informal protocols there is no syntax at all, you just implement the methods
without declaring anything.
Historically, almost all protocols were informal but more recently (especially
after improvements in Objective-C 2.0) we are starting to use formal ones more
often.
- Abhi
PS: Even in Xcode/Cocoa I have had more luck creating NSTextView's
programatically than with interface builder. It's a complicated system and
there are a lot of edge case bugs/performance bottlenecks unless you create the
whole system programatically (Apple has a very good guide, I think titled
"creating the text system programatically").