Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Ken Thomases
On Sep 26, 2015, at 5:33 PM, Jerry Krinock wrote: > In a OS X app, predating Grand Central Dispatch, in the main thread, I create > and start a new thread > > NSThread* worker ; > worker = [[NSThread alloc] initWithTarget:instance > selector:@selector(beginWithIn

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Jerry Krinock
> On 2015 Sep 26, at 18:03, Quincey Morris > wrote: > > I don’t understand what you’re asking. I mean that if it is possible for -[NSThread start] to block indefinitely, it is not a useable API. I clicked the “Pause” and “Continue” multiple times in Xcode, but each time, in the main thread,

Re: Continue application processing with mouse down on a menu

2015-09-27 Thread Scott Ribe
On Sep 26, 2015, at 12:19 PM, Programmingkid wrote: > > I just wish there were an easy way for the a task on the main thread to > continue to work even if the user is looking at a menu. Using multiple > threads has a lot of problems associated with it. A simple way to interleave execution of t

Re: Continue application processing with mouse down on a menu

2015-09-27 Thread Scott Ribe
On Sep 26, 2015, at 12:00 PM, Programmingkid wrote: > > I did try using a separate thread, but that caused part of the application to > stop responding to events. A background thread will *not* cause your application to stop responding to events. You need to go back and look more closely at w

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Jens Alfke
> On Sep 27, 2015, at 6:50 AM, Jerry Krinock wrote: > > I mean that if it is possible for -[NSThread start] to block indefinitely, it > is not a useable API. It’s not. The new thread will start when the kernel's scheduler gives it time. That’s technically indefinite, but realistically micros

How to get remote metadata

2015-09-27 Thread Gerriet M. Denkmann
I want to get some metadata for a remote file. I tried: NSString *path = @"/Public/UNIDATA/Blocks.txt"; NSURL *icuBlocksUrl = [ [ NSURL alloc ] initWithScheme: @"http" host: @"unicode.org" path: path ]; NSArray *keys = @[ NSURLContentModificationDateKey, NSURLCreationDateKey, NSURLFileSizeKey

Re: How to get remote metadata

2015-09-27 Thread Mike Abdullah
> On 27 Sep 2015, at 18:08, Gerriet M. Denkmann wrote: > > I want to get some metadata for a remote file. > I tried: > > NSString *path = @"/Public/UNIDATA/Blocks.txt"; > NSURL *icuBlocksUrl = [ [ NSURL alloc ] initWithScheme: @"http" host: > @"unicode.org" path: path ]; > NSArray *keys = @[

Drawing many different strings quickly

2015-09-27 Thread Ben
Hi list, I'm needing to draw somewhere in the order of 1,000,000 different strings in a scrollable grid view and am struggling to get performance that I am happy with. After profiling, most of my time is spent in drawing text into the view. My first attempt was simply to use NSString's drawInRe

Re: Drawing many different strings quickly

2015-09-27 Thread Quincey Morris
On Sep 27, 2015, at 10:42 , Ben wrote: > > - Not all strings to be drawn at once, a scroll view is being used and I am > using responsive scrolling to pre-draw areas. The problem occurs when quickly > scrolling a large distance I think your answer is in this statement. Assuming you’re drawing

o Swift generics, y no can I haz u dispatch correctly?

2015-09-27 Thread has
Hi all, So, as part of my ongoing quest to discover all the exciting ways in which Swift can perplex and frustrate me†, I'm trying to solve the last major blocker on my SwiftAE project (https://bitbucket.org/hhas/swiftae), which is how to use Swift's static typing to determine how NSAppleEven

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread John Daniel
> In a OS X app, predating Grand Central Dispatch, in the main thread, I create > and start a new thread > > NSThread* worker ; > worker = [[NSThread alloc] initWithTarget:instance > selector:@selector(beginWithInfo:) > object:inf

ARC, blocks, capture variables

2015-09-27 Thread Scott Ribe
Given a block instance var named fun: fun = ^void () {[self ...];}; Results in the warning: "Capturing 'self' strongly in this block is likely to lead to a retain cycle" But I know that it does not result in a retain cycle, because I nil out fun at the appropriate time. So how to get rid of th

Re: o Swift generics, y no can I haz u dispatch correctly?

2015-09-27 Thread Quincey Morris
On Sep 27, 2015, at 15:02 , has wrote: > > The problem is, it all falls apart again when `AppData.unpack()` is called > from another generic method: > >class Commands { >func get(v:Any) -> T { >return d.unpack(v, returnType: T.self) as T >} >} I think you’re

Re: ARC, blocks, capture variables

2015-09-27 Thread Quincey Morris
On Sep 27, 2015, at 17:17 , Scott Ribe wrote: > > But I know that it does not result in a retain cycle, because I nil out fun > at the appropriate time. So how to get rid of the warning? IIRC you can simply assign ‘self’ to a local variable just before assigning to ‘fun', and use the local va

Re: ARC, blocks, capture variables

2015-09-27 Thread Scott Ribe
On Sep 27, 2015, at 7:03 PM, Quincey Morris wrote: > > IIRC you can simply assign ‘self’ to a local variable just before assigning > to ‘fun', and use the local variable name instead of ‘self’ inside the block. Well, that does work. Thanks! -- Scott Ribe scott_r...@elevated-dev.com http://w

Re: Drawing many different strings quickly

2015-09-27 Thread Graham Cox
Hi Ben, You may find that responsive scrolling is actually making things worse in this case, because many more strings than you can see are being drawn, and string drawing is expensive. Have you tried opting out of responsive scroling? Apart from that, usual advice applies - draw the very minim

Re: Continue application processing with mouse down on a menu

2015-09-27 Thread Programmingkid
On Sep 27, 2015, at 10:33 AM, Scott Ribe wrote: > On Sep 26, 2015, at 12:19 PM, Programmingkid > wrote: >> >> I just wish there were an easy way for the a task on the main thread to >> continue to work even if the user is looking at a menu. Using multiple >> threads has a lot of problems ass

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Jerry Krinock
On 2015 Sep 27, at 17:01, John Daniel wrote: > There is no way to tell what is causing the deadlock without knowing exactly > what is happening relating to: > 1) instance > 2) beginWithInfo: > 3) info Thank you, John. You are referring to what my secondary thread is doing. My point is that

Re: Drawing many different strings quickly

2015-09-27 Thread Jens Alfke
Use an NSTableView. It knows how to manage unlimited numbers of rows efficiently. --Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-ad

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Jens Alfke
—Jens > On Sep 27, 2015, at 8:49 PM, Jerry Krinock wrote: > > My point is that if we can’t at least rely on -[NSThread start] returning > before the secondary starts, there is no way for a seconary thread to call > back to the main thread without possibility of deadlock. Why? You do real

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Charles Srstka
> On Sep 27, 2015, at 11:18 PM, Jens Alfke wrote: > >> On Sep 27, 2015, at 8:49 PM, Jerry Krinock > > wrote: >> >> My point is that if we can’t at least rely on -[NSThread start] returning >> before the secondary starts, there is no way for a seconary thread to call >> b

Re: -[NSThread start] blocks ?!?

2015-09-27 Thread Ken Thomases
> On Sep 27, 2015, at 8:49 PM, Jerry Krinock wrote: > > My point is that if we can’t at least rely on -[NSThread start] returning > before the secondary starts, there is no way for a seconary thread to call > back to the main thread without possibility of deadlock. No, this isn't true. The on

Re: How to get remote metadata

2015-09-27 Thread Gerriet M. Denkmann
> On 28 Sep 2015, at 00:31, Mike Abdullah wrote: > > >> On 27 Sep 2015, at 18:08, Gerriet M. Denkmann wrote: >> >> I want to get some metadata for a remote file. >> >> Just seen in small print: “This method applies only to URLs that represent >> file system resources.” >> >> So this is no

Re: How to get remote metadata

2015-09-27 Thread Quincey Morris
On Sep 27, 2015, at 22:43 , Gerriet M. Denkmann wrote: > > The NSHTTPURLResponse allHeaderFields dictionary contains keys like: > “Content-Length” and “Last-Modified”. > Are these standardized or might other sites use other keys like > “Modification-Date” or “Nbr-of-Bytes” ? https://en.wikiped