delegates Questions

3

Solved

How can I get the delegation class of a member property? By this, I mean is it possible to complete such a function: inline fun <reified T> delegationExample(t: T) { for (prop in T::class....
Strake asked 10/9, 2016 at 1:18

4

Solved

I have two textFields on the screen and a Submit button. User inputs details in first textField and then the second one. My requirement is to end the editing when Submit button is clicked and pri...
Walke asked 16/12, 2015 at 22:3

7

Solved

I am trying to learn some c# coding and wondering if the c++ concept of function pointers is included in c#. I see there are such things as delegates. Are they the same concept? or do they differ o...
Sosthina asked 29/4, 2010 at 16:4

1

Solved

For some reason, despite this question coming up a lot in my googling, I can't seem to find an actual answer. Maybe I'm just using delegates wrong, I'm not sure. I'm happy for alternative ways of h...
Ras asked 10/9, 2021 at 7:22

16

How handle the event when press the 'x' button? I try this method but not works. -(void)searchBarCancelButtonClicked:(UISearchBar *)searchBar{ }
Errant asked 19/3, 2015 at 1:15

5

Solved

I have this code: public void myMethod() { int a = 10; int b = 20; Func<int, int, int> multiplyDelegate; multiplyDelegate = Multiply; multiplyDelegate += Multiply2; Console.WriteLine(...
Hardecanute asked 25/4, 2017 at 12:19

3

Solved

I would like to implement "pull down to refresh" type effect on a UIScrollview. On detecting "top" bounce of the scrollview, the view should refresh some of the components. How can I detect the "to...
Nickolas asked 27/12, 2013 at 17:39

2

Solved

I am learning "contravariant generic delegate". My understanding is: The "in" keyword specifies that the type parameter is contravariant. This allows for implicit conversion of...
Moonstruck asked 24/8, 2021 at 8:25

5

Solved

The question is in the title. In Objective-C, if I want to have a property (like a delegate) that HAS to adhere to a certain protocol it can be defined like so: @property (weak) id<MyDelegate&g...
Addams asked 18/5, 2015 at 17:3

12

i am new to ios. I need to know the current view controller from app delegate.. i have no idea about this and i don't knowto implement this. i am using this code toimplemnt this but it return null ...
Moll asked 18/7, 2014 at 12:31

6

I have a function I want to Moq. The problem is that it takes 5 parameters. The framework only contains Action<T1,T2,T3,T4> and Moq's generic CallBack() only overloads Action and the four gen...
Text asked 29/3, 2010 at 20:13

2

Solved

I made a custom class that handles audio recording/playback and put a Protocol in that class. I implemented the Protocol in a UIViewController class and called my setDelegate method for my AudioHel...
Cytaster asked 27/4, 2015 at 19:42

2

Solved

I know about EventInfo.AddEventHandler(...) method which can be used to attach handler to an event. But what should be done if i can not even define proper signature of the event handler, as in, i ...
Bloomer asked 25/6, 2010 at 18:22

6

I want to be able to do the equivalent to the following at runtime: var action = new Action<ANYTHING AT RUNTIME>(obj => Console.WriteLine("Called = " + obj)); I know I need to get the c...
Crucify asked 26/8, 2012 at 15:22

3

Solved

I've seen several Scala questions recently (e.g. here, here, and here) that called for the use of proxies, and it's come up more than once in my own work. The Scala library has a number of proxy tr...
Poetaster asked 13/8, 2010 at 1:40

3

Solved

None of my UICollectionViewDelegateFlowLayout methods are called. Can somebody help me find a solution? In my ViewDidLoad method, I have set delegate and datasource for collection view as self.col...
Clink asked 29/1, 2017 at 11:23

6

Solved

I've been looking at strategy pattern implementation examples and it seems to me like they are very similar to c# delegates. The only difference I see is that strategy pattern implementations don't...
Marinara asked 9/2, 2009 at 19:31

1

Solved

I am quite new to react native and and the bridging mechanism with native code, especially when the framework has delegates. Assume I am trying to bridge the following framework: @protocol BRPtouc...
Vaughnvaught asked 2/7, 2018 at 9:25

4

Solved

I have a method which accepts an Action delegate and executes the given method as shown here: public void ExpMethod(Action inputDel) { inpuDel(); } I can call above given method like this: Exp...
Hailee asked 26/1, 2017 at 9:4

2

Solved

Why this code will print only "A" and "B", but not "C" ? Action act = null; act += () => MessageLog.Message("A"); act += () => MessageLog.Message(&quot...
Howrah asked 22/4, 2021 at 9:3

6

Solved

I just switched over from iPhone to Android and am looking for something similar to where in the iPhone SDK, when a class finishes a certain task, it calls delegate methods in objects set as it's d...
Girovard asked 23/9, 2010 at 19:14

9

Solved

I have a class like below: class Foo { public Foo(int x) { ... } } and I need to pass to a certain method a delegate like this: delegate Foo FooGenerator(int x); Is it possible to pass the c...
Karinkarina asked 21/10, 2009 at 13:4

8

Solved

It probably isn't even possible to do this, but I will ask anyway. Is it possible to create a function that receives a string and then uses it as a right side argument for the goes to operator (=>)...
Tapdance asked 3/7, 2009 at 16:23

5

Solved

I want to perform a action when the user pressed the back button on my UINavigationController when arrived at a certain UIViewController. Unfortunately it looks like UINavigationControllerDelegate...
Hackberry asked 9/3, 2011 at 13:57

9

Solved

What is Func<> and what is it used for?
Tremblay asked 2/9, 2010 at 7:45

© 2022 - 2024 — McMap. All rights reserved.