• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

What are Delegates?

 
Hussein Baghdadi
clojure forum advocate
Bartender
Posts: 3479
Clojure Mac Objective C
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey,
Are "Delegates" in iPhone jargon equivalent to listeners and callbacks in Java applications?
Thanks.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Todd wrote:Hey,
Are "Delegates" in iPhone jargon equivalent to listeners and callbacks in Java applications?
Thanks.


Basically.

Mark
 
Kaydell Leavitt
Ranch Hand
Posts: 690
Eclipse IDE Firefox Browser Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
John Todd wrote:Hey,
Are "Delegates" in iPhone jargon equivalent to listeners and callbacks in Java applications?
Thanks.


Delegates are helper objects that make it so that you don't have to subclass a class. For example the application object has a delegate that you can subclass so that you don't have to subclass the application object. Many other classes also can have delegates.

-- Kaydell
 
sickwell secran
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i think too
 
gourav kumar
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A delegate is a form of type-safe function pointer used by the .NET Framework. Delegates specify a method to call and optionally an object to call the method on. They are used, among other things, to implement callbacks and event listeners.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
gourav kumar wrote:A delegate is a form of type-safe function pointer used by the .NET Framework. Delegates specify a method to call and optionally an object to call the method on. They are used, among other things, to implement callbacks and event listeners.


This is the iPhone forum, so nothing related to .NET

Mark
 
nik gen
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

There is a apple doc that explain the Delegate very nicely.
http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/CocoaFundamentals/CommunicatingWithObjects/CommunicateWithObjects.html#//apple_ref/doc/uid/TP40002974-CH7-SW18

Also there a nice explanation in this forum too. Hope it helps to understand much better.
http://stackoverflow.com/questions/626898/how-do-i-create-delegates-in-objective-c


Thanks,
Niketa.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic