Re: How to tell if there's an active runloop?

2014-03-26 Thread Charles Srstka
On Mar 26, 2014, at 4:33 PM, Jens Alfke wrote: > Is there a way to tell whether the current thread has an active runloop? > > I ask because the library that I develop will internally call > -performSelector:withObject:afterDelay to schedule an action at a later time. > The library can be used

Re: accessing values along NSIndexPath

2014-03-26 Thread Charles Srstka
On Mar 26, 2014, at 3:14 PM, Torsten Curdt wrote: > Going through a NSTreeController feels like cracking a nut with a > sledge-hammer. > Then I would rather roll my own. > > There is really no other way? You could make your objects subclasses of NSTreeNode, and use its -mutableChildNodes prop

Re: How to prevent a temp folder from being deleted

2014-03-26 Thread Kyle Sluder
On Wed, Mar 26, 2014, at 03:08 PM, Mills, Steve wrote: > I'm looking for a way to prevent the folder from being deleted either by > the OS or by the user while the app is still running. As a test, I set > the NSFileBusy and NSFileImmutable flags on a file in our temp folder, > but I was still able

Re: accessing values along NSIndexPath

2014-03-26 Thread Torsten Curdt
From the docs it sounds pretty standard: https://developer.apple.com/library/mac/documentation/cocoa/Reference/Foundation/Classes/NSIndexPath_Class/Reference/Reference.html#//apple_ref/occ/cl/NSIndexPath strange - but fair enough. cheers, Torsten On Wed, Mar 26, 2014 at 10:26 PM, Jens Alfke wr

Re: How to tell if there's an active runloop?

2014-03-26 Thread Ken Thomases
On Mar 26, 2014, at 4:48 PM, Kyle Sluder wrote: > On Wed, Mar 26, 2014, at 02:33 PM, Jens Alfke wrote: >> I’d like to be able to detect this situation and log a warning or throw >> an exception. But I can’t figure out what to check. I know that >> [NSRunLoop currentRunLoop] will create a new runlo

How to prevent a temp folder from being deleted

2014-03-26 Thread Mills, Steve
It appears that items in the TemporaryItems folder that are older than 3 days will be periodically deleted. (One of our guys found some Darwin docs that mention this.) This is a problem for users of our app that might keep it running for more than 3 days. We store a temp folder in there that mig

Re: How to tell if there's an active runloop?

2014-03-26 Thread Jens Alfke
On Mar 26, 2014, at 2:48 PM, Kyle Sluder wrote: > If you want to delay something for later, you should probably use > dispatch_after. I’d love to, except that background threads don’t correspond to dispatch queues. People who are [still] using NSThreads should be able to use this library. (

Re: How to tell if there's an active runloop?

2014-03-26 Thread Kyle Sluder
On Wed, Mar 26, 2014, at 02:33 PM, Jens Alfke wrote: > I’d like to be able to detect this situation and log a warning or throw > an exception. But I can’t figure out what to check. I know that > [NSRunLoop currentRunLoop] will create a new runloop for the current > thread if one doesn’t exist, so i

How to tell if there's an active runloop?

2014-03-26 Thread Jens Alfke
Is there a way to tell whether the current thread has an active runloop? I ask because the library that I develop will internally call -performSelector:withObject:afterDelay to schedule an action at a later time. The library can be used on a background thread, with some caveats. A couple of tim

Re: accessing values along NSIndexPath

2014-03-26 Thread Jens Alfke
On Mar 26, 2014, at 1:14 PM, Torsten Curdt wrote: > There is really no other way? Yes, if you’ve got a custom data model, then you’ll need to write custom code to navigate it with an index-path. NSArrays-of-NSArrays aren’t really in common use in Cocoa, so they count as a custom data model IM

Re: accessing values along NSIndexPath

2014-03-26 Thread Gary L. Wade
If all you have is a nested set of arrays, then you¹ll have to write your own objectAtIndexPath: method that walks your nested set of arrays. -- Gary L. Wade http://www.garywade.com/ On 3/26/2014, 1:14 PM, "Torsten Curdt" wrote: >Going through a NSTreeController feels like cracking a nut with a

Re: accessing values along NSIndexPath

2014-03-26 Thread Torsten Curdt
Going through a NSTreeController feels like cracking a nut with a sledge-hammer. Then I would rather roll my own. There is really no other way? On Wed, Mar 26, 2014 at 8:56 PM, Lee Ann Rucker wrote: > First you need a NSTreeController to manage your NSArray, then: > >NSTreeNode *topNode = [t

Re: accessing values along NSIndexPath

2014-03-26 Thread Lee Ann Rucker
First you need a NSTreeController to manage your NSArray, then: NSTreeNode *topNode = [treeController arrangedObjects]; return [topNode descendantNodeAtIndexPath:indexPath]; On Mar 26, 2014, at 12:02 PM, Torsten Curdt wrote: > The Apple docs state: > > "The NSIndexPath class represents t

accessing values along NSIndexPath

2014-03-26 Thread Torsten Curdt
The Apple docs state: "The NSIndexPath class represents the path to a specific node in a tree of nested array collections" I can't find how to use the index path to access the tree though. It should be something along the lines of: NSIndexPath *indexPath = ... NSArray *nestedArrays = ... i

Re: NSInteger/NSUInteger Considerations (64 bit)

2014-03-26 Thread Chris Hanson
On Mar 25, 2014, at 4:55 PM, Jens Alfke wrote: > So if something is supposed to be a particular size (as seems to happen in > your app) declare it as a type of that size. If you don’t care about the size > and it won’t ever exceed a few billion, use `int` or `unsigned`. If it needs > to hold h

Re: Simulating sublayers in CATiledLayer

2014-03-26 Thread Remco Poelstra
Finally it works! I now have a CALayer backed UIView with CATiledLayer sublayers with full zooming support. I'm not entirely sure what change actually turned it into something working, but I'm happy it does work now. Thanks for all support. Remco Graham Cox schreef op 26-3-2014 1:04: Did yo

Re: NSInteger/NSUInteger Considerations (64 bit)

2014-03-26 Thread Dave
On 26 Mar 2014, at 00:14, Rick Mann wrote: > When dealing with structures on disk, I've created packed structs that > exactly match the on-disk layout, then applied byte swapping before writing > or after reading as appropriate. Then I just write or read the struct as a > buffer. This gets a

Re: Get session key from SSL/TLS connection using NSStream

2014-03-26 Thread Jens Alfke
On Mar 26, 2014, at 3:30 AM, Bastian Hafer wrote: > Now, when the connection is established and working, is there any way to get > hands on the session key that is negotiated in the SSL/TLS handshake > protocol? I need this key for my app. Maybe via the socket, the stream itself > or any obje

Re: Get session key from SSL/TLS connection using NSStream

2014-03-26 Thread Roland King
I'm pretty sure the answer here is no. I can think of nothing which exposes that session key, I can believe that it's something an API would not lightly expose and I do wonder what you could possibly need it for, especially on iOS, I can almost think of ways to use it on OSX, almost, but on iOS

Get session key from SSL/TLS connection using NSStream

2014-03-26 Thread Bastian Hafer
Hey everyone, I am trying to get the session key of an existing, working and tested connection secured via SSL/TLS. The connection is set up using first CFReadStream and CFWriteStream then casted to NSInputStream and NSOutputStream as common. Before I open them I set the properties and values f

Re: Write with NSFileWrapper vs. copy with NSFileManager

2014-03-26 Thread Mike Abdullah
On 26 Mar 2014, at 10:19, Colas B wrote: > > What is the difference between writing a hard link and just ignore this > particular file that has not changed ? If the file is already there, where > the hard link will be created? > > Envoyé depuis Yahoo Mail pour iPad NSFileWrapper doesn’t sup

Re : Re: Write with NSFileWrapper vs. copy with NSFileManager

2014-03-26 Thread Colas B
What is the difference between writing a hard link and just ignore this particular file that has not changed ? If the file is already there, where the hard link will be created?https://overview.mail.yahoo.com?.src=iOS";>Envoyé depuis Yahoo Mail pour iPad _

Re: Write with NSFileWrapper vs. copy with NSFileManager

2014-03-26 Thread Mike Abdullah
On 26 Mar 2014, at 10:13, Colas B wrote: > > Yes indeed, > > I'm using this method to manage additional data in a document. > Want you say Mike frightens me a little bit, I would not want all my memory > used my extra files when I save the document. > > Which options should I use if I want

Re : Re: Write with NSFileWrapper vs. copy with NSFileManager

2014-03-26 Thread Colas B
Yes indeed, I'm using this method to manage additional data in a document.Want you say Mike frightens me a little bit, I would not want all my memory used my extra files when I save the document.Which options should I use if I want the file wrapper to read/write as less as possible when I updat

Re: GIF frame duration

2014-03-26 Thread Diego Torres
Oh, ok, well, in that case you can use the CoreGraphics APIs to read the raw properties Sent from my iPhone > On Mar 25, 2014, at 13:30, Andreas Mayer wrote: > > >> Am 25.03.2014 um 17:12 schrieb D. Felipe Torres : >> >> That is normal and documented behaviour for GIFs. >> >> Here are some

Re: GIF frame duration

2014-03-26 Thread D. Felipe Torres
That is normal and documented behaviour for GIFs. Here are some links about it: http://nullsleep.tumblr.com/post/16524517190/animated-gif-minimum-frame-delay-browser-compatibility http://blogs.msdn.com/b/ieinternals/archive/2010/06/08/animated-gifs-slow-down-to-under-20-frames-per-second.aspx On

Re: Image without profile gets an sRGB profile on Mavericks

2014-03-26 Thread edward taffel
quartz is color managed—all rasters are tagged: when you import an untagged jpeg, srgb is assigned [a likely/logical candidate to characterize an untagged jpeg]. if your app is color managed [is it?] you should present similar options to what you see when you reopen the file in photoshop [allow

CALayer shadow and zPosition

2014-03-26 Thread Graham Cox
I have a series of CALayers which are all siblings within a hosting layer. I want one of these layers to have a shadow, so I set the shadow properties. Problem is that the shadow draws behind all of the sibling layers. So, I tried setting the zPosition of the shadowed layer so that it's well 'in