delegates Questions

1

This is a slightly abstract question about finding a pretty design approach with minimal boilerplate. Prerequisites: I have an ENUM class for enumerating various providers i.e.: enum class Provi...
Afterheat asked 20/3, 2018 at 20:13

0

I am trying to send gesture messages from several subclassed UIViews to common handlers in a UIViewController called TouchController. I am using a customised protocol to address a question arising ...
Rhizotomy asked 15/3, 2018 at 22:52

1

Solved

I have the following program which construct a local Func from two static methods. But strangely, when I profile the program, it allocated close to a million Func objects. Why invoking Func object ...
Gatekeeper asked 15/3, 2018 at 12:25

1

Solved

UPDATE 2 The question in its current form has been answered and accepted even though a problem remains viz. the code now compiles with 0 warnings but still remains unresponsive to gestures. Code w...
Oke asked 12/3, 2018 at 23:52

2

Solved

Lets say we have a delegate public delegate void MyEventHandler(string x); and an event handler public event MyEventHandler Something; we add multiple events.. for(int x = 0; x <10;...
Tedious asked 18/3, 2016 at 12:30

7

Solved

All of the Func<T> delegates return a value. What are the .NET delegates that can be used with methods that return void?
Lepp asked 27/5, 2009 at 19:21

1

Im doing some research to get tableview delegate methods exact order of execution. Case 1: Number of rows - For small values So firstly I have created 100 rows and found the execution flow as bel...
Canossa asked 2/11, 2017 at 6:42

4

Solved

I have two UITableViewControllers and need to pass the value from the child view controller to the parent using a delegate. I know what delegates are and just wanted to see a simple to follow examp...
Tattoo asked 29/5, 2011 at 16:33

1

I'm getting a crash EXC_Breakpoint which would indicate to me that there is a nil variable being unwrapped? The line of code it is pointing to is the definition of let obHeight: if let qs = Helpe...
Volunteer asked 7/2, 2018 at 12:16

2

Solved

I've been using Progress<T> and wondered if it can be replaced by Action<T>. In the code below, using each of them for reporting progress, i.e. ReportWithProgress() or ReportWithAction...
Peoria asked 5/2, 2018 at 14:48

1

I've observed that Whenever the compiler encountered a delegate declaration like the following: public delegate string StringOperation(string myString); Then the compiler is generating the ...
Older asked 2/2, 2018 at 12:10

5

I am not sure if I understood the usage of delegates correctly but I would like to read delegate return value in publisher class. The example is below with description. //Publisher class public ...
Extremist asked 16/4, 2012 at 12:22

3

Solved

Why isn't it possible to assign events along with properties in object initializers in C#? It seems to be so natural to do so. var myObject = new MyClass() { Property = value, Event1 = actor, ...
Flare asked 22/10, 2010 at 3:6

2

GCDAsyncSocket delegates not being called in swift class, but works very well in UIViewController class. Below is my custom class code, in this class connect function will start socket connection a...
Load asked 2/6, 2016 at 12:49

5

Solved

what is the exact meaning of delegate in iphone?how it is implemented in UIViewController?
Varini asked 5/6, 2010 at 3:13

3

Solved

Could anyone explain the meaning of someViewController.delegate = self and self.delegate? Where do they help us?
Hypothetical asked 18/11, 2010 at 5:27

1

Solved

I'm trying to make this code working: protected async Task RunIsolated<TServ1, TServ2>(Action<TServ1, TServ2> action) { await RunInScope(action, typeof(TServ1), typeof(TServ2)); } pr...
Bradshaw asked 28/12, 2017 at 11:50

6

Solved

I have gone through many articles but I am still not clear about the difference between the normal delegates that we usually create and multicast delegates. public delegate void MyMethodHandler(ob...
Scintillate asked 3/2, 2010 at 13:38

7

Solved

Which is more correct and why? Control.BeginInvoke(new Action(DoSomething), null); private void DoSomething() { MessageBox.Show("What a great post"); } or Control.BeginInvoke((MethodInvoker) ...
Druci asked 22/7, 2009 at 19:47

1

Solved

I'm working on a library that has several places where a user can inject a lambda function to customize a complex background process. They are essentially making small modifications to how the libr...
Herl asked 20/12, 2017 at 1:3

3

I'm trying to implement a protocol that itself inherits multiple protocols that both have a delegate member. Is there a clean way to do this without needing different names for the delegate of each...
Alanealanine asked 23/11, 2014 at 3:3

1

Solved

Kotlin has delegated properties which is a very nice feature. But I am figuring out how to get and set the values. Let's say I want to get value of the property which is delegated. In a get() metho...
Amparoampelopsis asked 4/12, 2017 at 13:31

7

Solved

There are two parts to this question: Does raising an event block the thread, or does it start execution of EventHandlers asynchronously and the thread goes continues on at the same time? Are the...
Conceivable asked 18/8, 2011 at 11:11

4

Solved

I have been trying to learn how delegation with protocols work. I understood everything, but I can't think of when to use delegation other than when using table views and possibly scroll view...
Unparliamentary asked 9/11, 2016 at 7:19

4

Solved

So I have an object which has some fields, doesn't really matter what. I have a generic list of these objects. List<MyObject> myObjects = new List<MyObject>(); myObjects.Add(myObject1);...
Bowie asked 12/9, 2008 at 14:45

© 2022 - 2024 — McMap. All rights reserved.