• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Passing C Style Function Callbacks in Cocoa
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.


  • Follow-Ups:
    • Re: Passing C Style Function Callbacks in Cocoa
      • From: Clark Cox <email@hidden>
    • Re: Passing C Style Function Callbacks in Cocoa
      • From: Allan Odgaard <email@hidden>
    • Re: Passing C Style Function Callbacks in Cocoa
      • From: Ondra Cada <email@hidden>
References: 
 >Re: Passing C Style Function Callbacks in Cocoa (From: John Nairn <email@hidden>)

  • Prev by Date: Re: OS X 10.3.x, Address Book, and initWithVCardRepresentation
  • Next by Date: Re: NSUndoManager -removeActionsWithTarget: does nothing
  • Previous by thread: Re: Passing C Style Function Callbacks in Cocoa
  • Next by thread: Re: Passing C Style Function Callbacks in Cocoa
  • Index(es):
    • Date
    • Thread