delegates

Passing a delegate to another view controller's delegate

空扰寡人 提交于 2020-01-07 02:59:33
问题 I'm working to build one feature in an app written in Objective-C. I can't post code but I will try to be descriptive with my world. The problem i'm facing is related to delegates. AlphaViewController has ConnectionView as one of its delegate . It helps to add perform some operation on data provided to AlphaViewController and we show output on AlphaViewController's view. When you click on a button in AlphaViewController , I show an UIAlertController . From which I can click a button to open

Call a method when a generic event occurs

若如初见. 提交于 2020-01-07 01:51:59
问题 I'm facing a problem when trying to implement a call to a method fired up by an event which should be defined during run-time. I found this answer: Redirecting to a dynamic method from a generic event handler and implemented that solution, but I keep getting an exception when the method to call is an instance one, not static. Here is my partial code: public class Operation { public bool EventFired { get { return _eventFired; } } private bool _eventFired = false; public void Execute(object

Call a method when a generic event occurs

自闭症网瘾萝莉.ら 提交于 2020-01-07 01:51:17
问题 I'm facing a problem when trying to implement a call to a method fired up by an event which should be defined during run-time. I found this answer: Redirecting to a dynamic method from a generic event handler and implemented that solution, but I keep getting an exception when the method to call is an instance one, not static. Here is my partial code: public class Operation { public bool EventFired { get { return _eventFired; } } private bool _eventFired = false; public void Execute(object

GWT retrieve list from datastore via serviceimpl

谁都会走 提交于 2020-01-07 01:31:59
问题 Hi I'm trying to retrieve a linkedhashset from the Google datastore but nothing seems to happen. I want to display the results in a Grid using GWT on a page. I have put system.out.println() in all the classes to see where I go wrong but it only shows one and I don't recieve any errors. I use 6 classes 2 in the server package(ContactDAOJdo/ContactServiceImpl) and 4 in the client package(ContactService/ContactServiceAsync/ContactListDelegate/ContactListGui). I hope someone can explain why this

Method cannot be a member of an @objc protocol while using Dictionary

那年仲夏 提交于 2020-01-06 14:38:52
问题 I am coding in swift. I have written a protocol @objc protocol ServerDelegate { optional func onDownloadDataComplete (downloadedData data : [Dictionary<String,Any>],result : ResultType,error : String) } First I received "Method cannot be a member of an @objc protocol because the type of the parameter 2 cannot be represented in Objective-C" for my enum but I fixed it by adding @objc. Now I am receiving this for Array of Dictionary. How to fix it? 回答1: As @originaluser2 said Any cannot be

How to solve a delegate that is still nil

时光总嘲笑我的痴心妄想 提交于 2020-01-06 14:06:04
问题 I am concerned with my 4 view controllers. The first one is the CardWalletViewController which is a table view that is populated by Card Objects that the user has created (the card creation is OK so I won't post the code regarding that). Now, given that this table view is already populated with Card Objects, once the user clicks on a cell, another view controller, named CardDetailsViewController will show up. This will display the current points that the Card has and also the perks. Note that

How to solve a delegate that is still nil

孤人 提交于 2020-01-06 14:05:08
问题 I am concerned with my 4 view controllers. The first one is the CardWalletViewController which is a table view that is populated by Card Objects that the user has created (the card creation is OK so I won't post the code regarding that). Now, given that this table view is already populated with Card Objects, once the user clicks on a cell, another view controller, named CardDetailsViewController will show up. This will display the current points that the Card has and also the perks. Note that

data between Views UIApplication

落花浮王杯 提交于 2020-01-06 12:44:17
问题 i want to share data between views... i have the appdelegate of tabbar application: myappdelegate.h #import <UIKit/UIKit.h> @interface myappdelegate : NSObject <UIApplicationDelegate, UITabBarControllerDelegate> { UIWindow *window; UITabBarController *tabBarController; NSString *result; } @property (nonatomic, retain) IBOutlet UIWindow *window; @property (nonatomic, retain) IBOutlet UITabBarController *tabBarController; @property (copy , readwrite) NSString *result; @end if i want to call

In WCF is it possible to pass a delegate to the remote object?

纵饮孤独 提交于 2020-01-06 02:44:07
问题 Is it possible to pass a delegate to a WCF remote object from the client and have the remote object execute the delegate? I would guess not since a delgate is a function pointer for the client process. My goal is to have an interface structure that I can "subscribe" to events from a client to the interface. I would pass a delgate from the client to the interface and I want the interface to be able to execute the event. The idea is to have the ability for the interface to be loaded either the

What is the equivalent C# code for a VB.NET anonymous delegate?

旧时模样 提交于 2020-01-06 02:13:08
问题 What is the equivalent C# code for the following VB.NET: Dim moo = Function(x as String) x.ToString() I thought that this should work: var moo = (string x) => x.ToString(); but that yielded a compiler error: Cannot assign lamda expression to an implicitly-typed local variable After some further investigation, I discovered that the type of the variable moo ( moo.GetType() ) in the VB example is VB$AnonymousDelegate_0'2[System.String,System.String] Is there anything equivalent to this in C#?