Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pointer to id



On Jan 2, 2006, at 3:08 AM, Sanri Parov wrote:
mmmhhhh.....
I've tried doing this:

NSValue *value;
value = [NSValue valueWithPointer:@encode(PortAudioStream *)];
[value retain];
[NSThread detachNewThreadSelector: @selector(playForSure:) toTarget: nil withObject:value];

(1) Don't use @encode(). valueWithPointer: just takes a raw pointer; it needs no information about what it is a pointing to.


(2) You are passing nil as the target for invocation of -playForSure: in the detached thread. This effectively does absolutely nothing as there is no way for NSThread to know whose -playForSure: method should be invoked.

If -playForSure: is implemented on self, then pass self as the target.

b.bum

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Pointer to id (From: Sanri Parov <email@hidden>)
 >Re: Pointer to id (From: Pontus Ilbring <email@hidden>)
 >Re: Pointer to id (From: Sanri Parov <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.