Re: NSThread - plz help!!!
Re: NSThread - plz help!!!
- Subject: Re: NSThread - plz help!!!
- From: John Hörnkvist <email@hidden>
- Date: Thu, 7 Mar 2002 00:50:11 +0100
On Thursday, March 7, 2002, at 12:11 AM, Lukasz Kuczborski wrote:
i have such a while loop:
while(pname = [direnum nextObject])
{
if([[[direnum fileAttributes] fileType]
isEqualToString:NSFileTypeRegular])
{
Table *nowy = [[Table alloc] init];
[nowy setIconCell:[[NSWorkspace sharedWorkspace]
iconForFile:[fullPath stringByAppendingPathComponent:pname]]];
[nowy setPathToFile:[fullPath
stringByAppendingPathComponent:pname]];
[nowy setFileExtension:[pname pathExtension]];
[nowy setFileName:[pname lastPathComponent]];
[fileSpecs addObject:nowy];
[nowy release];
[table reloadData]; =====>>>>> *****i want this operation
(reloading TableView) to be threaded (NSThread class), so i could view
files
in my table one by one till next file is found during the
searching....PLEASE HELP...this is really important!!!*****
}
}
Run the loop in a secondary thread and post events (eg by using shared a
queue of NSInvocations) to the main thread.
If you want something ready made, OmniFoundation has some classes for
multi threading that might help. (OFMessageQueue)
You could replace the reloadData call above with
[[OFMessageQueue mainQueue] queueSelector:@selector(reloadData)
forObject:table];
Regards,
John Hornkvist
--
ToastedMarshmallow, the perfect Cocoa companion
http://www.toastedmarshmallow.com is relocating.
Try
http://217.215.121.176 in the meantime
_______________________________________________
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.