Re: NSMenu in NSTableView column

2014-08-13 Thread Jonathan Taylor
I would create a class, say, SignalChannel, with name (for description, but we may not ant to use description for obvious reasons...) and channelID properties. I would then populate the NSPopupButtonCell with SignalChannel objects. This will abstract the model from the view, which is better

Translating to Swift

2014-08-13 Thread Gerriet M. Denkmann
How could I translate this to Swift? + (Thing *)sharedThing { static Thing *commonThing; static dispatch_once_t justOnce; dispatch_once( justOnce, ^void { commonThing = [ [ Thing alloc ] init ]; } );

Re: Translating to Swift

2014-08-13 Thread Jean-Daniel Dupas
At global scope var sharedThing : Thing = Thing(); Le 13 août 2014 à 12:30, Gerriet M. Denkmann gerr...@mdenkmann.de a écrit : How could I translate this to Swift? + (Thing *)sharedThing { static Thing *commonThing; static dispatch_once_t justOnce; dispatch_once(

diff tool on iOS?

2014-08-13 Thread Koen van der Drift
Is there any way to use a diff tool in an iOS app? My app at one point needs to find the difference between two large text files, and using diff or something similar may be a possible solution. Both files are downloaded as NSData objects from an external source, and right now I have converted them

Re: diff tool on iOS?

2014-08-13 Thread ChanMaxthon
I think you can embed code from BSD diff in your program. That is plain C and you just need to call it using your Objective-C code. Alternatively you can look into the implementation of BSD diff or GNU diffutils and rewrite it using Objective-C or Swift for your project. Sent from my iPad On

Re: diff tool on iOS?

2014-08-13 Thread Koen van der Drift
I thought about diff, but can I use that without NSTask, etc which aren't available on iOS? Also came across this: https://github.com/inquisitiveSoft/DiffMatchPatch-ObjC, which could be useful. Thanks for your imput, - Koen. On Wed, Aug 13, 2014 at 9:03 AM, ChanMaxthon xcvi...@me.com wrote:

Re: diff tool on iOS?

2014-08-13 Thread Sergio Campamá
I think he meant to replicate the diff functionality inside your app, and handle the output your own way to display the results. AFAIK, you can't call any command line programs from an iOS app... -- Sergio Campamá sergiocamp...@gmail.com On Wed, Aug 13, 2014

Re: NSMenu in NSTableView column

2014-08-13 Thread Keary Suska
On Aug 13, 2014, at 4:04 AM, Jonathan Taylor jonathan.tay...@glasgow.ac.uk wrote: I would create a class, say, SignalChannel, with name (for description, but we may not ant to use description for obvious reasons...) and channelID properties. I would then populate the NSPopupButtonCell with

Re: diff tool on iOS?

2014-08-13 Thread Koen van der Drift
Thanks the clarification, I misread the answer. Any tips for where I can find the source code for BSD diff? I found the GNU diffutils already here: http://www.gnu.org/software/diffutils/. - Koen. On Wed, Aug 13, 2014 at 10:41 AM, Sergio Campamá sergiocamp...@gmail.com wrote: I think he

Re: NSMenu in NSTableView column

2014-08-13 Thread Jonathan Taylor
Ah, I've worked out the underlying problem I've been having. I had been trying things along these lines and completely failing to get the popup menu to populate correctly. It was working for a standalone popup but not within the table, and I was assuming I was doing something wrong and/or

Re: diff tool on iOS?

2014-08-13 Thread Marco S Hyman
On Aug 13, 2014, at 7:54 AM, Koen van der Drift koenvanderdr...@gmail.com wrote: Any tips for where I can find the source code for BSD diff? I found the GNU diffutils already here: http://www.gnu.org/software/diffutils/. Try one of the bsd source repositories. An example that I'm familiar

Re: Advise on referencing NSDocument from custom view

2014-08-13 Thread Luc Van Bogaert
I've reworked my model, view and controller classes in the way you've indicated below. Thanks. I do have another question about this kind of setup. In the process I decided that it would be a good idea to have a designated initializer for my custom view that sets a reference to the model

Backup eligibility (iCloud/iTunes) for iOS shared app group container

2014-08-13 Thread Ben Kennedy
Hello all, What is the persistence and backup policy for files stored in an app group shared container on iOS 8 -- that is, the directory returned by -[NSFileManager containerURLForSecurityApplicationGroupIdentifier:] ? More specifically, can I treat this directory in a similar manner as the

Re: Advise on referencing NSDocument from custom view

2014-08-13 Thread Quincey Morris
On Aug 13, 2014, at 11:31 , Luc Van Bogaert luc.van.boga...@me.com wrote: My question now is , where I should remove MyView as an observer with 'self.model removeObserver: self forKey: @property...' '? I tried to do this in 'dealloc', but it seems that from time to time my model object is

KVO query

2014-08-13 Thread Jonathan Mitchell
I have a key path like so which is observed: submission.status.name At one point i need to invoke a manual KVO notification like so: [submission willChangeValueForKey:@“status”]; [submission didChangeValueForKey:@“status”]; This raises like so: Terminating app due to uncaught exception

Re: KVO query

2014-08-13 Thread Lee Ann Rucker
Have you implemented +automaticallyNotifiesObserversForKey: and returned NO for “status” ? On Aug 13, 2014, at 2:53 PM, Jonathan Mitchell jonat...@mugginsoft.com wrote: I have a key path like so which is observed: submission.status.name At one point i need to invoke a manual KVO

Re: KVO query

2014-08-13 Thread Ken Thomases
On Aug 13, 2014, at 4:53 PM, Jonathan Mitchell jonat...@mugginsoft.com wrote: I have a key path like so which is observed: submission.status.name At one point i need to invoke a manual KVO notification like so: [submission willChangeValueForKey:@“status”]; [submission

Re: KVO query

2014-08-13 Thread Quincey Morris
On Aug 13, 2014, at 14:53 , Jonathan Mitchell jonat...@mugginsoft.com wrote: At one point i need to invoke a manual KVO notification like so: [submission willChangeValueForKey:@“status”]; [submission didChangeValueForKey:@“status”]; This raises like so: Terminating app due to uncaught

autolayout-based animation on NSView

2014-08-13 Thread Roland King
I have a constraint-based NSView layout which I can flip between states by adjusting the constraint priorities and/or constants, and/or removing and replacing some constraints. At the same time I make some views invisible or visible again. All that stuff say is in a method on the view ..

Re: autolayout-based animation on NSView

2014-08-13 Thread Ken Thomases
On Aug 13, 2014, at 8:22 PM, Roland King r...@rols.org wrote: I have a constraint-based NSView layout which I can flip between states by adjusting the constraint priorities and/or constants, and/or removing and replacing some constraints. At the same time I make some views invisible or

Re: autolayout-based animation on NSView

2014-08-13 Thread Roland King
It should work to do: [view layoutSubtreeIfNeeded]; [NSAnimationContext runAnimationGroup:^(NSAnimationContext *context){ context.duration = 0.25; // you can leave this out if the default is acceptable context.allowsImplicitAnimation = YES; [view