Questions tagged [delegation]

A delegate is a type that references a method

A delegate is a type that references a method. Once a delegate is assigned a method, it behaves exactly like that method. The delegate method can be used like any other method, with parameters and a return value

719 questions
-1
votes
1 answer

Android - Linear Layout default onClickListener that delegates clicks?

I have a Map view with some pins of certain locations, whenever a location is pressed a bottom LinearLayout popup is displayed. Whenever the user clicks on the map but not on the popup, the popup is dismissed. We have a bug, that whenever the popup…
-1
votes
1 answer

Please explain to me class delegation in Kotlin

I don't understand the (BY) keyword in Kotlin like this: interface a { } class b():a { } class c(x:a):a by x { }
Safwen Chaieb
  • 13
  • 1
  • 2
-1
votes
2 answers

Delegate from View Controller through Navigation Controller to Page Controller

I have an Page View Controller containing two Navigation Controllers, which are embedding view controllers. Is it possible to pass data directly from the View Controller to the Page View Controller. I want to use the delegation pattern, but I think…
-1
votes
1 answer

How can I extend the functionality of apache FTPFile?

I'm learning OOP in Java and I've come across a problem. I need to create a custom object Folder that retains the functionality of the FTPFile object and add some more to it. FTPClient client = new FTPClient(); FTPFile[] folders =…
-1
votes
1 answer

Message flow in Objective-C

Does anyone have a good reference which really outlines how this entire 'message flow' between classes, subclasses, etc.... works in Objective-C? It seems very central to the architecture of the programming environment in Mac world and would be…
joseph ruth
  • 219
  • 2
  • 11
-1
votes
1 answer

event not bubbling like I think it should

I have a dynamically generated page of items in an inventory. I am trying to create an onclick event so that if the user clicks on the displayed item information or image the event listner executes. I can make it work by adding an…
wm_g
  • 15
  • 5
-1
votes
2 answers

Can't link jQuery

Here is my HTML:
merkur0
  • 162
  • 1
  • 2
  • 13
-1
votes
1 answer

Swift Delegation Issue

I use delegation in Swift on a regular basis and have implemented it successfully on a number of projects. I am currently having an issue I don't understand. After my CreateMessageBEDelegate delegate fires the call back method, the CreateMessageBE…
jonthornham
  • 1,669
  • 1
  • 13
  • 18
-1
votes
3 answers

Swift delegates isn't working

I'm trying to use delegates between two controllers but it doesn't work as it should be protocol saveDelegate: class { func saveSite() } class AuditSiteViewController: UIViewController { weak var delegate: saveDelegate? @IBAction func…
Abdoelrhman
  • 875
  • 8
  • 17
-1
votes
2 answers

delegation and passing data back from childViewController

I have been struggling with this for a few days and have received valuable help on the way from S.O. I have made the simplest possible project to reduce the possibilities of it being a typo. All my project is, is a ViewController that holds a…
Paul
  • 1,045
  • 4
  • 22
  • 46
-1
votes
1 answer

Java OOP design: what patterns can be used to design a hierarchy in which tasks/methods can be delegated between different instances of objects?

For example, if I have a person class, but each instance of a person can have 0 or more position or job - which have specific abilities and responsibilities - that he/she can switch between at will.
geoxile
  • 328
  • 1
  • 5
  • 15
-1
votes
1 answer

Delegation in Ruby

I have a class Klass, and its constructor accepts an argument. We should be able to call methods on this object that are not defined in Klass. We can chain multiple methods, but in the end, we have to use Klass#result to get the result…
mariya
  • 255
  • 4
  • 12
-1
votes
1 answer

C++ postfix incrementation in a for loop; stacks; composition/delegation

I searched for similar questions, but could not find one that I could apply to my situation. I have a stack class using an array class as a data member. I test it with push and pop in 'main()' on a stack of size 5 (in this case, data member 'Array…
kits
  • 577
  • 4
  • 19
-1
votes
1 answer

Simple passing of data through delegation in objective C

I'm using Xcode to write an app in objective c. I am trying to pass data from a container view controller to the parent view controller using delegation. I have successfully passed the data to the parent view controller, but all of the…
-1
votes
1 answer

Where to set delegate = self? Or should I just use a different design pattern?

EDIT: edited for clarity Disclaimer: I'm new and pretty bad. But I have tried very hard and read lots of stuff to figure this out, but I have not... I think my whole delegate pattern would work, except I can't figure out how to set the delegate…
Paul Pan
  • 76
  • 8
1 2 3
47
48