Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

what is the exact meaning of delegate in iphone?how it is implemented in UIViewController?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
983 views
Welcome To Ask or Share your Answers For Others

1 Answer

A delegate is an object that usually reacts to some event in another object and/or can affect how another object behaves. The objects work together for the greater good of completing a task. Typically a delegate object will be shared by many other objects that have a more specific task to carry out. The delegate itself will be more abstract and should be very reusable for different tasks. The object which contains the delegate typically sends the delegate a message when a triggered event occurs, giving the delegate an opportunity to carry out its specified task.

There's more documentation here that you should read to understand the delegate pattern in Cocoa and Cocoa touch, particularly with how delegation is used between UIWindow and UIView. It is an integral design pattern in iPhone architecture and one that should be mastered if you wish to design a clean application.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...