¡@

Home 

2014/10/15 ¤U¤È 10:12:13

iphone Programming Glossary: nswindow

What programming skills I need to become an iPhone developer? [closed]

http://stackoverflow.com/questions/1043820/what-programming-skills-i-need-to-become-an-iphone-developer

datasources . If you have a special window that can't be closed except in certain circumstances you don't subclass NSWindow you almost never subclass NSWindow for anything . You assign a delegate to the NSWindow instance and when it wants to close.. window that can't be closed except in certain circumstances you don't subclass NSWindow you almost never subclass NSWindow for anything . You assign a delegate to the NSWindow instance and when it wants to close it asks its delegate windowShouldClose.. you don't subclass NSWindow you almost never subclass NSWindow for anything . You assign a delegate to the NSWindow instance and when it wants to close it asks its delegate windowShouldClose . .NET has lots of objects that do similar things..

How do I create delegates in Objective-C?

http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c

a formal protocol you must declare your delegate to implement that protocol see below. For example suppose you have an NSWindow. If you'd like to implement its delegate's windowDidMove method you could create a class like this @implementation MyClass.. and assign it as the window's delegate MyClass myDelegate MyClass alloc init window setDelegate myDelegate On the NSWindow side it probably has code similar to this to see if the delegate responds to the windowDidMove message using respondsToSelector.. There are two basic approaches discussed in the Apple Docs on protocols 1 An Informal Protocol This can be done as NSWindow does in a category on NSObject. For example continuing the example above this is paraphrased from NSWindow.h @interface..