As I know, NSApplicationDelegate is available in SDK for 10.6
Is there any similar protocol as NSApplicationDelegate for ealier version(mine is 10.5.8)?
Thank
interdev
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Functionally, yes. But formally, no.
The point is, protocols before Objective-C 2.0 didn’t have the concept of optional methods. Therefore, something called informal protocol was used instead. Basically, the header files just added a category to
NSObjectas inThis way, the compiler won’t warn you when you call a delegate method on an arbitrary object. Now it’s formalized as a formal protocol:
When you implement an application delegate, the difference would be in 10.5 and before you would have
while you would have in 10.6 and later
So, as you find in the documentation for
NSApplicationDelegate, the protocol is formalized in 10.6 but not before. However, the functionality has been there since 10.0.The Cocoa world changes quite quickly, and the documentation tends to describe only the latest version, so I would recommend you to upgrade to 10.6 if it’s possible. That will save you tons of hours of hair-scratching, especially if you’re a beginner.