Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Leonardo
NSURLIsAliasFileKey returns YES even in case of SymLinks. And I need to return YES only in case of Aliases. Regards -- Leonardo > Da: Charles Srstka > Data: Sat, 28 Nov 2015 10:51:05 -0600 > A: Leonardo > Cc: "Gary L. Wade" , > Oggetto: Re: FSIsAliasFile deprecated - typeOfFile is slow > >>

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Leonardo
Thank you Gary. Almost got it. Still a small question. The 8th byte of the buffer, in case of alias (file or folder) returns -128 and not 128 as you said. Am I missing something? - (BOOL)IsAlias { const char*cPath = [[NSFileManager defaultManager] fileSystemRepresentationWithPath:self];

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Gary L. Wade
When looking at bytes and doing things like this, I prefer using uint8_t rather than char or unsigned char since it's more representative (this is basic signed/unsigned arithmetic); besides, you don't want to do an equal-check but a bit-check since it's a flags field. Technically both buffer[8]

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Jens Alfke
> On Dec 1, 2015, at 4:03 AM, Leonardo wrote: > > NSURLIsAliasFileKey returns YES even in case of SymLinks. > And I need to return YES only in case of Aliases. Then call lstat() to check if it’s a symlink. —Jens ___ Cocoa-dev mailing list (Cocoa-dev

Re: Design pattern for Painting applications, where to start

2015-12-01 Thread colo0logo
I had long in the past, perhaps I should revisit. I was hoping there was a previous dialogue pertaining to its evolution somewhere. I'll search around some more with its title. Thank you. On Mon, Nov 30, 2015 at 3:04 PM, Jens Alfke wrote: > Have you looked at the (Mac OS) Sketch sample app? It’s

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Charles Srstka
> On Dec 1, 2015, at 11:27 AM, Jens Alfke wrote: > >> >> On Dec 1, 2015, at 4:03 AM, Leonardo wrote: >> >> NSURLIsAliasFileKey returns YES even in case of SymLinks. >> And I need to return YES only in case of Aliases. > > Then call lstat() to check if it’s a symlink. Or use resourceValuesFor

Re: TableviewSelectionDidChange(_:) not called

2015-12-01 Thread Luc Van Bogaert
> On 30 Nov 2015, at 22:57, Quincey Morris > wrote: > > On Nov 30, 2015, at 12:18 , Luc Van Bogaert wrote: >> >> I can see this is being called when I make any selection change; except when >> I delete the (last) selected row. Deleting the second last row does trigger >> a call, but only wh

Re: TableviewSelectionDidChange(_:) not called

2015-12-01 Thread Quincey Morris
On Dec 1, 2015, at 12:15 , Luc Van Bogaert wrote: > > As I already had an outlet to the ArrayController, I tried to solve this > problem by observing its 'selectedObjects' property, which seems to work fine. > I guess that would practically be the same as what you have suggested? Practically t

iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Carl Hoefs
I was about to implement my own singleton class to act as an app-wide context repository, but then I thought: wouldn't it be simpler just to use the appDelegate for that purpose? It's a singleton already and available to all classes via [[UIApplication sharedApplication] delegate]. All I need to

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Alex Zavatone
I'm more of a fan of special case singletons, or else you essentially create one big global al over again. Also, the AppDelegate class has certain responsibilities. For organizational purposes, I feel most comfortable in creating a singleton for the purpose of the task at hand. On Dec 1, 20

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Roland King
> On 2 Dec 2015, at 04:58, Carl Hoefs wrote: > > I was about to implement my own singleton class to act as an app-wide context > repository, but then I thought: wouldn't it be simpler just to use the > appDelegate for that purpose? It's a singleton already and available to all > classes via [

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Leonardo
That works perfectly. You are extremely precise. Thank you. I have successfully checked it with aliases with type 'alis' (file), 'fdrp' (folder) and 'fapa' (filePackage application). I guess I¹d have to check the whole list here below, but sincerely I don¹t even know how to create e.g. a kContainer

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Quincey Morris
On Dec 1, 2015, at 12:58 , Carl Hoefs wrote: > available to all classes via [[UIApplication sharedApplication] delegate]. > Are there any drawbacks to this? I don’t find this practice very objectionable, but the drawback is that '[[UIApplication sharedApplication] delegate]’ has the wrong clas

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Carl Hoefs
The following seems to be working out for me. #import "AppCommon.h" @implementation AppCommon + (AppCommon *)shared { static AppCommon *shared = nil; static dispatch_once_t token; dispatch_once(&token, ^{ shared = [[self alloc] init]; }); return shared; } -Carl > On

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Rick Mann
> > >> On Dec 1, 2015, at 4:55 PM, Quincey Morris >> wrote: >> >> On Dec 1, 2015, at 12:58 , Carl Hoefs > > wrote: >> >>> available to all classes via [[UIApplication sharedApplication] delegate]. >> >>> Are there any drawbacks to this? I've found it's

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Quincey Morris
On Dec 1, 2015, at 16:20 , Carl Hoefs wrote: > The following seems to be working out for me. > > #import "AppCommon.h" > @implementation AppCommon > + (AppCommon *)shared > { > static AppCommon *shared = nil; > static dispatch_once_t token; > dispatch_once(&token, ^{ > shared

Re: FSIsAliasFile deprecated - typeOfFile is slow

2015-12-01 Thread Gary L. Wade
I'm glad I could help. I know these things because I've worked on some backup and sync solutions for some rather well-known companies targeting fairly recent versions of OS X, so performance, correct solutions, and minimal impact to the user are very important to me. Some aliases in that list d

How to import a Framework

2015-12-01 Thread Gerriet M. Denkmann
I just made a Framework (Xcode 7.1), called ProcArgFramework. I copied it into /Library/Frameworks. In some other Project I added: @import ProcArgFramework But Xcode says: “Module ProcArgFramework not found”. I tried all sorts of variations of this import-line. But all to no avail. How

Re: How to import a Framework

2015-12-01 Thread Roland King
> On 2 Dec 2015, at 10:39, Gerriet M. Denkmann wrote: > > I just made a Framework (Xcode 7.1), called ProcArgFramework. > I copied it into /Library/Frameworks. > > In some other Project I added: > > @import ProcArgFramework > > But Xcode says: “Module ProcArgFramework not found”. > > I

Re: How to import a Framework

2015-12-01 Thread Gerriet M. Denkmann
> On 2 Dec 2015, at 09:51, Roland King wrote: > > >> On 2 Dec 2015, at 10:39, Gerriet M. Denkmann wrote: >> >> I just made a Framework (Xcode 7.1), called ProcArgFramework. >> I copied it into /Library/Frameworks. >> >> In some other Project I added: >> >> @import ProcArgFramework >>

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Alex Zavatone
What does Apple do on this? I think their standard is to use shared in the name. On Dec 1, 2015, at 7:33 PM, Quincey Morris wrote: > On Dec 1, 2015, at 16:20 , Carl Hoefs wrote: > >> The following seems to be working out for me. >> >> #import "AppCommon.h" >> @implementation AppCommon >> +

Re: How to import a Framework

2015-12-01 Thread Jens Alfke
> On Dec 1, 2015, at 7:12 PM, Gerriet M. Denkmann wrote: > > “When you build an application or other executable, the compiler looks for > frameworks in/System/Library/Frameworks as well as any other location > specified to the compiler.” That hasn’t been true for a long time, at least since t

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Luther Baker
The conversation here is pretty loose ... and so everyone might be right in what they are intending to convey... ;-) but I thought I'd just put in a vote to stop using the term "Singleton" for this access pattern. It isn't a Singleton (unless there is historical signficance that grandfathers this i

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Alex Zavatone
On Dec 2, 2015, at 12:24 AM, Luther Baker wrote: > The conversation here is pretty loose ... and so everyone might be right in > what they are intending to convey... ;-) but I thought I'd just put in a vote > to stop using the term "Singleton" for this access pattern. It isn't a > Singleton (u

Re: iOS: Using AppDelegate as an app-wide singleton

2015-12-01 Thread Quincey Morris
On Dec 1, 2015, at 21:38 , Alex Zavatone wrote: > > On Dec 2, 2015, at 12:24 AM, Luther Baker wrote: > >> Alex, the API uses lots of different words to grab a-hold of the so-called >> "standard", "default" or "shared" static instance. Unfortunately, I'm not >> aware of any docs that specify wh