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

761 questions
-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
  • 12
-1
votes
2 answers

Can't link jQuery

Here is my HTML:
ondrejm
  • 154
  • 1
  • 3
  • 17
-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
  • 2,881
  • 4
  • 19
  • 35
-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
  • 906
  • 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,277
  • 5
  • 28
  • 56
-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
  • 348
  • 1
  • 6
  • 16
-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
  • 295
  • 1
  • 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
  • 609
  • 6
  • 20
-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
  • 9
-1
votes
1 answer

Delegation: delegated method doesn't see outlets

I have two views in the Tab Bar View. I want my second view to inform first view, when its Text Fields have changed value. I've done all the necessary coding for it, but there is one problem - first view doesn't see connected label outlets in the…
-1
votes
1 answer

objective-c: delegate after sub-classing

Well, i try to explain my problem: I sub-classed MyMapView from GMSMapView @interface MyMapView : GMSMapView @end Now i use MyMapView in MyViewController.m to show up a GMSMap and setup the delegate GMSMapViewDelegate. @implementation…
grethi
  • 146
  • 11
-1
votes
2 answers

Understanding ios and objective-c @property

What is the difference between: @interface PhotoAppViewController : UIViewController { UIImageView * imageView; UIButton * choosePhotoBtn; UIButton *…
cdub
  • 24,555
  • 57
  • 174
  • 303
-1
votes
2 answers

passing data from ControllerA to Controller B and then to ControllerC

I am beginning wit iOS and trying getting to understand how delegates work for passing data. I understand how to pass Data from ControllerA to ControllerB. Now what would be the best approach for passing data from ControllerA to Controller B and…
Edu
  • 25
  • 9
-2
votes
0 answers

php delegation pattern example

I am studing Kotlin and understand better the Delegation Pattern I've just asked to ChatGPT an example of Delegation Pattern for PHP but give me only a lambda example function eseguiOperazione($operazione, $valore) { return…
carlo denaro
  • 425
  • 6
  • 14
1 2 3
50
51