All Questions

665
votes
18answers
303286 views

How do I create delegates in Objective-C?

I know how delegates work, and I know how I can use them. But how do I create them?
124
votes
3answers
120585 views

How do I set up a simple delegate to communicate between two view controllers?

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 example....
702
votes
9answers
156848 views

Why would you use Expression<Func<T>> rather than Func<T>?

I understand lambdas and the Func and Action delegates. But expressions stump me. In what circumstances would you use an Expression<Func<T>> rather than a plain old Func<T>?
190
votes
11answers
51859 views

Unsubscribe anonymous method in C#

Is it possible to unsubscribe an anonymous method from an event? If I subscribe to an event like this: void MyMethod() { Console.WriteLine("I did it!"); } MyEvent += MyMethod; I can un-subscr...
108
votes
11answers
109942 views

Delegates in swift?

How does one go about making a delegate, i.e. NSUserNotificationCenterDelegate in swift?
479
votes
9answers
424687 views

Pass Method as Parameter using C#

I have several methods all with the same signature (parameters and return values) but different names and the internals of the methods are different. I want to pass the name of the method to run to a...
162
votes
4answers
36424 views

What's the best way to communicate between view controllers?

Being new to objective-c, cocoa, and iPhone dev in general, I have a strong desire to get the most out of the language and the frameworks. One of the resources I'm using is Stanford's CS193P class no...
48
votes
5answers
48567 views

How does a delegate work in objective-C?

Does anyone know where I can find a good explanation/tutorial of what and how an application delegate works in objective-C? The two books I have don't dwell on delegates enough and do not explain th...
96
votes
4answers
16161 views

Compiler Ambiguous invocation error - anonymous method and method group with Func<> or Action

I have a scenario where I want to use method group syntax rather than anonymous methods (or lambda syntax) for calling a function. The function has two overloads, one that takes an Action, the other ...
248
votes
9answers
95549 views

What are the differences between delegates and events?

What are the differences between delegates and an events? Don't both hold references to functions that can be executed?

Previous Next