• 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: NSThread - plz help!!!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >NSThread - plz help!!! (From: Lukasz Kuczborski <email@hidden>)

  • Prev by Date: Re: Filename of File Relative to Directory It's In
  • Next by Date: Re: Help Please?
  • Previous by thread: Re: NSThread - plz help!!!
  • Next by thread: How to use objC in C++
  • Index(es):
    • Date
    • Thread