> Basically I just need to use a function pointer. How does Cocoa do this?
Put a function pointer member in your class and set it before you call
detachNewThreadSelector on it...
--
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice
_
2009/4/11 Trygve Inda :
> [NSThread detachNewThreadSelector:@selector(threadMethod:) toTarget:self
> withObject:@selector(myMethod)];
This should have produced a warning like this:
warning: passing argument 3 of
‘detachNewThreadSelector:toTarget:withObject:’ from incompatible
pointer type
If it
Sigh. Hit shift-cmd-D a bit too soon. :)
It does not seem I can invoke this on the main thread.
An NSInvocation?
[invocation performSelectorOnMainThread: @selector(invokeWithTarget:)
withObject: ...whatever... waitUntilDone: NO];
Basically I just need to use a function pointer. How does C
>> It does not seem I can invoke this on the main thread.
> An NSInvocation?
>> Basically I just need to use a function pointer. How does Cocoa do
>> this?
>>
>> I need to pass either someMethod or someOtherMethod and later call
>> it with
>>
>> [self performSelectorOnMainThread:theMethod withO
> 2009/4/11 Trygve Inda
>
> I have a thread. Depending on how it is called, I need to do something
>> different at the end of the main processing so I wanted to pass a selector
>> into the thread so it could call it when it was ready.
>>
>> I could just pass an NSNumber and do case1, case2 etc,
2009/4/11 Trygve Inda
I have a thread. Depending on how it is called, I need to do something
> different at the end of the main processing so I wanted to pass a selector
> into the thread so it could call it when it was ready.
>
> I could just pass an NSNumber and do case1, case2 etc, but thought
On Apr 11, 2009, at 5:32 PM, Trygve Inda wrote:
So one of these needs to be called:
[self performSelectorOnMainThread:@selector(cacheComplete)
withObject:nil
waitUntilDone:NO];
[self performSelectorOnMainThread:@selector(initComlete)
withObject:nil
waitUntilDone:NO];
Thoughts?
On Apr
> On Apr 11, 2009, at 5:20 PM, Trygve Inda wrote:
>> -(void)threadMethod:(id)anObject
>> {
>> NSAutoreleasePool*pool = [[NSAutoreleasePool alloc] init];
>> SEL comp = (SEL)anObject;
>>
>>... Do stuff ...
>>
>> [self performSelectorOnMainThread:comp withObject:nil
>> w
On Apr 11, 2009, at 5:20 PM, Trygve Inda wrote:
-(void)threadMethod:(id)anObject
{
NSAutoreleasePool*pool = [[NSAutoreleasePool alloc] init];
SEL comp = (SEL)anObject;
... Do stuff ...
[self performSelectorOnMainThread:comp withObject:nil
waitUntilDone:NO];
[pool
[NSThread detachNewThreadSelector:@selector(threadMethod:) toTarget:self
withObject:@selector(myMethod)];
-(void)threadMethod:(id)anObject
{
NSAutoreleasePool*pool = [[NSAutoreleasePool alloc] init];
SEL comp = (SEL)anObject;
... Do stuff ...
[self performSelecto
10 matches
Mail list logo