Re: Passing C Style Function Callbacks in Cocoa
Re: Passing C Style Function Callbacks in Cocoa
- Subject: Re: Passing C Style Function Callbacks in Cocoa
- From: Alessandro Volz <email@hidden>
- Date: Fri, 5 Mar 2004 19:49:36 +0100
On the same subject, here's my other question:
i am passing a @selector(boolReturningMethod:) and later invoking it
thru
BOOL b = [target performSelector:action withObject:whatever];
this all works well but at compilation time i get the warning:
warning: passing arg 1 of `setEnabled:' makes integer from pointer
without a cast
you'll think, just typecast it! well...
BOOL b = (BOOL)[target performSelector:action withObject:whatever];
warning: cast from pointer to integer of different size
where's the trick? i can live with this but you'll admit that a
warning-free app is already kind of satisfacting...
thanks in advance
Ale
On 5 Mar 2004, at 17:56, John Nairn wrote:
>
On Mar 5, 2004, at 8:42 AM, email@hidden wrote:
>
>
> 'm a Object C newbie and hope someone here can help. I need to pass a
>
> function call-back to a C- style function from one of my objects. I
>
> have declared the call-back function before the @implementation MyObj.
>
> The problem I'm having is accessing my object from within the
>
> call-back
>
> function, which doesn't seem to know about my object. I want the
>
> callback to send a setter message to my object. I'd rather be able to
>
> pass a call-back that was a method of my object instead. Is there a
>
> way
>
> to pass a Obj C style message as a function* in place of the C-style
>
> function???
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.