This is a weird issue. I have created a view controller with a nib file for my modal view. On that view there is a label, number and text view. When I create the view from the source view, I tried to set the label, but it shows that the label is null (0x0). Kinda weird... Any suggestions? Now lets look at the code (I put all of the ...
I get a null exception if I try to pass a null parameter to a delegate during an invoke. Here's what the code looks like:
public void RequestPhoto()
{
WCF.Service.BeginGetUserPhoto(Contact.UserID,
new AsyncCallback(RequestPhotoCB), null);
}
public void RequestPhotoCB(IAsyncR...
I've only recently noticed a crash in one of my apps when an object tried to message its delegate and the delegate had already been released.
At the moment, just before calling any delegate methods, I run this check:
if (delegate && [delegate respondsToSelector:...]){
[delegate ...];
}
But obviously this doesn't account for if the...
I have three classes like this.
class A
{
public class innerB
{
//Do something
}
public class innerC
{
//trying to access objB here directly or indirectly over here.
//I dont have to create an object of innerB, but to access the object created by A
//i.e.
innerB ...
I have started to use anonymous delegates a lot in C# and I have begun to wonder how efficient the complier or runtime is in removing them from the code that is actually run and I haven't seen this detailed anywhere?
Is it clever enough at all to inline them and collapse recursive uses that could be statically deduced?
...
I'm trying to translate code from this thread in python:
import sys
from PyQt4.QtCore import *
from PyQt4.QtGui import *
__data__ = [
"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
"Ut enim ad minim veniam, quis nostrud exercitation ull...
Possible Duplicate:
Can someone distill into proper English what a delegate is?
Hi All,
can somebody explain the use of delegate..I know that it is used to invoke methods at run time...but exactly what does it mean..can somebody explain it with some simple example, which will help a newcomer to understand delegate better
...
I have a case where I want a given event to execute once, and only once. I'm trying to do it this way, but I'm having prolems (else I wouldn't be asking). Note that the following code is inside the function that decides that the event needs to be fired.
EventHandler h = delegate(Object sender, EventArgs e) {
FiringControl.TheEvent...
I have a class that I want to be able the handle the mouse up event for a grid.
I tried to create it with a static method call like this:
MyDataBinding.BindObjectsToDataGrid(ListOfObjectsToBind, myGrid.MouseUp);
The end goal being that in the method I would assign a delegate to the MouseUp
PassedInMouseUp += myMethodThatWillHandleTh...
How do I pass a function pointer from managed C++ (C++/CLI) to an unmanaged method? I read a few articles, like this one from MSDN, but it describes two different assemblies, while I want only one.
Here is my code:
1) Header (MyInterop.ManagedCppLib.h):
#pragma once
using namespace System;
namespace MyInterop { namespace ManagedCppL...
Hey.
I'm loading in a UIWebView from another class, and that works great.
But now I need to know how I can implement these delegate methods:
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
// AND:
- (void)alertView:(UIAlertView *)alertView c...
what is the exact meaning of delegate in iphone?how it is implemented in UIViewController?
...
Hi all,
maybe my design is not good, or I don't see the obvious solution, but I want to subscribe to a buttonClick EventHandler of Form1 from outside form1.
For example I have a Controller and Form1 who are both instanced in the main function.
Now I want to subscribe a function from Controller to the buttonClick event from Button1_Cl...
Hi,
I am struggling with the correct design for the delegates of nsxmlparser.
In order to build my table of Foos, I need to make two types of webservice calls; one for the whole table and one for each row. It's essentially a master-query then detail-query, except the master-query-result-xml doesn't return enough information so i then n...
Let's say you have two objects (for example, a UITextviews, but it could be any type) in your class. When the text view changes, you have a delegate method that catches the change.. but how can you tell programatically WHICH object was changed and called the delegate ??
(Possible thought) Basically how to you get the variable name of a...
Hello all,
I am looking for good example code for using delegate and events in objective c?
i am familiar with delegate and events in C#.
so if someone can help me with few lines of code it will be very helpful.
...
How, in C#, do I have a Func parameter representing a method with this signature?
XmlNode createSection(XmlDocument doc, params XmlNode[] childNodes)
I tried having a parameter of type Func<XmlDocument, params XmlNode[], XmlNode> but, ooh, ReSharper/Visual Studio 2008 go crazy highlighting that in red.
Update: okay, Googling for 'c#...
I found a decent looking example of how to call a delegate asynchronously with a timeout... http://www.eggheadcafe.com/tutorials/aspnet/847c94bf-4b8d-4a66-9ae5-5b61f049019f/basics-make-any-method-c.aspx. In summary it uses WaitOne with a timeout to determine if the call does not return before the timeout expires.
I also know that you s...
I want to detach the custom event but could not detach. Below I am using -= to detach the event. I assume after this, the TextChanged2 method should not be invoked as I have unregistered the event. Is my understanding wrong?
public delegate void TextChangedEventHandler1(object sender, TextBoxargs ta);
public event TextChangedEventHandle...
Is it possible to adapt a method like this function "F"
class C {
public void F(int i);
}
to a delegate like Action<C,int>?
I have this vague recollection that Microsoft was working on supporting this kind of adaptation. But maybe I misremembered!
Edit: I know that this doesn't compile in VS2008:
class C {
public void F(int...