I've created a Delegate that I intend to call Async.
Module Level
Delegate Sub GetPartListDataFromServer(ByVal dvOriginal As DataView, ByVal ProgramID As Integer)
Dim dlgGetPartList As GetPartListDataFromServer
The following code I use in a method
Dim dlgGetPartList As New GetPartListDataFromServer(AddressOf AsyncThreadMethod_G...
I have a delegate for a method. I start it in a new thread that has a parameter in it in which I pass a DataView into. The new thread is obviously not running on the UI thread so I should not be accessing any UI controls. The dataview I am passing into the delegated method however I got the reference from ComboBox.DataSource where Com...
I have a fundamental question related to Cocoa frameworks design patterns.
What's the difference between delegate and data source?
Both of them could use @protocols declaration, but some classes or frameworks are using delegate, and some others are using data source.
All I can understand from UI/NSTableView is the delegate respond to ...
I am trying to call a method in my root view controller from a child view controller such that when I change my options they will automatically update the root view, which will in turn update several other view controllers. For the second part I have used notifications, but for this first I am trying to use a delegate because it (so I h...
Hi,
I am following sample code on implementing MVVM in Silverlight (see: http://msdn.microsoft.com/en-us/magazine/dd458800.aspx). On page 5 (when printed), the author has the following segment of code:
qry.BeginExecute(new AsyncCallback => a
{
try
{
IEnumerable<Game> results = qry.EndExecute(a);
if (GameLoadin...
Hello,
I know I need to write:
[delegate respondsToSelector:@selector(myMethod:)]
But the compiler is complaining that respondsToSelector is not a method in the protocol, which is correct, However I have seen many sample code use this, how do you do it?. Thank you.
-Oscar
...
main.m
#import <Cocoa/Cocoa.h>
int main(int argc, char *argv[])
{
return NSApplicationMain(argc, (const char **) argv);
}
CoolClass.h
#import <Cocoa/Cocoa.h>
@interface CoolClass : NSObject <NSApplicationDelegate> {
}
- (void) applicationDidFinishLaunching : (NSNotification *) aNotification;
@end
CoolClass.m
#import "CoolC...
I am new to iphone development.I want to access a variable declared in one view in another view.How can i achieve it.Whether it is possible by using extern variable, if so how to declare and implement it.Can i achieve it by using delegates?then so how to implement it.Please guide me.I am browsing google to get and idea to achieve it, i ...
I heard once that .net introduced an already defined delegate with no parameter that we could use instead of creating one.
I'm having a hard time finding it and for what version of .net. (if it really exists)
Thanks!
...
In my code below, I am using Process objects to execute a series of DOS batch files.
I'm shortening the list of scripts for example's sake.
The subsequent (1+) scripts execute via an event handler (instead of a for loop). That way, each subsequent script runs ONLY when the previous one finishes. Now for some reason as I execute the 2nd ...
If I assign a delegate property from classB to classA from Interface Builder, should I assign an IBOutlet to classB, then in classA dealloc, set the delegate to nil via the outlet? (Assuming classA is the file's owner of the XIB...)
...
given a delegate like
Func<string,string,string> MyFunc = (firstName,lastName) => string.Format("Given Name:{0} Surname:{1}",
firstName,
lastName);
How would you can you document the ...
Please explain your answers as I've gotten away with not having to do this so far.
Thanks
...
I think one of my design problems is that I keep creating navigation objects when I should only have one UINavigationController and a delegate. Is that correct?
I not as concerned from a style-preference, but the answer I am looking for is more about the a technical perspective and managing the navigation among several view controllers...
I have a database with LINQ to SQL ORM. I am manipulating the database with the repository pattern. My IAssignmentRepository implements INotifyCollectionChanged with its single event, CollectionChanged. I just want to know if it was possible (and senseless) for me to create a delegate (AssignmentsChangedDelegate) and event (AssignmentsCh...
Hi folks, can delegates be private, if not what's the reason behind this other than the normal restrictions caused by it being private.
TIA
...
I have this code:
public void setPanelHalfHorizontalScreen(Panel p)
{
if (p != null)
{
p.Width = Screen.PrimaryScreen.Bounds.Width / 2 - 2;
this.panelsForHalfScreen.Add(p.Name, p);
// http://stackoverflow.com/questions/2261828/does-an-event-gets-executed-tw...
Hi guys, I followed an example from "Beginning iPhone 3 Development" which puts the code for the main view controller, a Tab Bar, in the delegate method. Is this the correct place to put this or should it be in a separate .h and .m file? All my subviews are in separate files so I'm wondering if I should have my tab bar view controller ...
I have an abstract class which requires a delegate to function. I pass the delegate into the constructor. Now that I have a non default constructor I need to call the abstract class's constructors from the concrete class which means that I need to use MyBase.New(...). I have included a quick example below.
Public MustInherit Class BaseC...
I understand how delegates and events work. I can also imagine some common scenarios where we should implement events, but I’m having harder times understanding in what situations should delegates be used.
thanx
REPLYING TO USER KVB'S POST:
a)
You can basically use delegates wherever you would otherwise use a one-method interfa...