NSFileWrapper

2016-06-04 Thread Peter Hudson
Hi All Our users have now decided to push the bounds of the system - resulting in file sizes that are getting to large for comfort. It would be possible to fairly easily split the current file format into two and store it as two separate units. This is a particularly interesting solution as h

Overriding custom KVC methods in Swift?

2016-06-04 Thread Daryle Walker
I just looked through the Key-Value Coding Programming Guide, and I’m wondering what the prototypes are of the name-customized methods for your properties in Swift. Since the KVC protocol is informal, getting the names and/or types wrong doesn’t mean an error, but that your implementation is ig

Re: NSFileWrapper

2016-06-04 Thread Mike Abdullah
It sounds like you want your file format to be what is known as a “package”. It’s a directory, but is (mostly) presented as a single file. NSFileWrapper is an API for working with files, it does not directly control whether something is a package or not. It just happens to be the most convenien

Re: NSFileWrapper

2016-06-04 Thread Peter Hudson
Hi Mike You're right - I want the behaviour of a package. Do you happen to know how I can achieve it?   I had presumed it might be some mix of flag setting at system level. If for example i set the extension on an NSFileWrapper to   .bundle i get some of what I need - but I cant find out how to

Re: NSFileWrapper

2016-06-04 Thread Jens Alfke
> On Jun 4, 2016, at 9:18 AM, Peter Hudson wrote: > > You're right - I want the behaviour of a package. Do you happen to know how I > can achieve it? I had presumed it might be some mix of flag setting at > system level. If for example i set the extension on an NSFileWrapper to > .bundle

Re: Overriding custom KVC methods in Swift?

2016-06-04 Thread Quincey Morris
On Jun 4, 2016, at 07:10 , Daryle Walker wrote: > > Since the KVC protocol is informal, getting the names and/or types wrong > doesn’t mean an error, but that your implementation is ignored and default > handling is done. Well, there’s the same danger in Obj-C code, too. However, the clang com

Re: NSFileWrapper

2016-06-04 Thread Peter Hudson
Hi Jens “If your app’s performance is suffering because of large files, then use streams instead, and try to only read the part of the file that’s necessary.” Could you point me at some material about this technique ? It sounds very interesting. I will check out the database approach as well.

Re: NSFileWrapper

2016-06-04 Thread Jens Alfke
> On Jun 4, 2016, at 9:51 AM, Peter Hudson wrote: > > “If your app’s performance is suffering because of large files, then use > streams instead, and try to only read the part of the file that’s necessary.” > Could you point me at some material about this technique ? It sounds very > interest

How to implement a control/view that maps to a "String?" (in Swift)

2016-06-04 Thread Daryle Walker
I guess I could implement a “String” property with a NSTextView. What about a “String?” though. NIL and empty strings are distinct in the model, and I’ll like to reflect that in the document window too. (Although no one but me would pick a NIL option over an empty text-view and string.) I wa

Sorry to ask again, but maybe I'm asking the question incorrectly. Remote Notifications outside app delegate.

2016-06-04 Thread Alex Zavatone
When registering for push notifications, the success or failure methods are sent back to the application delegate in these methods - application:didRegisterForRemoteNotificationsWithDeviceToken: – application:didFailToRegisterForRemoteNotificationsWithError: Is it possible to "catch" these from

Re: Overriding custom KVC methods in Swift?

2016-06-04 Thread Daryle Walker
> On Jun 4, 2016, at 12:44 PM, Quincey Morris > wrote: > > On Jun 4, 2016, at 07:10 , Daryle Walker > wrote: >> >> Since the KVC protocol is informal, getting the names and/or types wrong >> doesn’t mean an error, but that your implementation is ignored and default >>

Re: Overriding custom KVC methods in Swift?

2016-06-04 Thread Quincey Morris
On Jun 4, 2016, at 12:54 , Daryle Walker wrote: > > It was the same except I mapped, based on the Swift w/ Cocoa & Obj-C guide, > the “id *” in the KVC guide to a “UnsafeMutablePointer”. Anyone > know why it’s different? It’s not unusual that the property being bound to can take a nil value,

Re: Sorry to ask again, but maybe I'm asking the question incorrectly. Remote Notifications outside app delegate.

2016-06-04 Thread Quincey Morris
On Jun 4, 2016, at 12:44 , Alex Zavatone wrote: > > I'm wondering if (man, I detest the term) method swizzling of the app > delegate would work or possibly modifying the methods of UIApplication at > runtime to pipe the methods to a class in the framework? > > Initially, i'm going to add them

Re: NSFileWrapper

2016-06-04 Thread Peter Hudson
Jens Thanks for these notes - extremely helpful. I think I will kick off with Realm and see where I get too. Peter > On 4 Jun 2016, at 20:36, Jens Alfke wrote: > > >> On Jun 4, 2016, at 9:51 AM, Peter Hudson > > wrote: >> >> “If your app’s performance is sufferi

Re: NSFileWrapper

2016-06-04 Thread Markus Spoettl
On 04/06/16 18:42, Jens Alfke wrote: I wouldn’t recommend NSFileWrapper for large files, because it reads all of a file into memory. I find this comment to be very misleading. Part of the reason why packages are so great (apart from being supported by NSDocument/AppKit as a method to store do

Re: NSFileWrapper

2016-06-04 Thread Quincey Morris
On Jun 4, 2016, at 14:10 , Markus Spoettl wrote: > > you have complete control over what individual file you read and when That’s fine for documents where it’s helpful not to have to read files only to write them out unchanged on a save. It doesn’t really help when you need to read large amoun

Re: Sorry to ask again, but maybe I'm asking the question incorrectly. Remote Notifications outside app delegate.

2016-06-04 Thread Quincey Morris
On Jun 4, 2016, at 14:14 , Alex Zavatone wrote: > > Currently, the hosting app just needs 1 line of code to start up and use a > whole app that is within the framework. Not being able to get the APNS token > within our framework makes it harder to … So why can’t the 1 line be in the app’s ap

Re: NSFileWrapper

2016-06-04 Thread Daryle Walker
> On Jun 4, 2016, at 12:18 PM, Peter Hudson wrote: > > Hi Mike > > You're right - I want the behaviour of a package. Do you happen to know how I > can achieve it? I had presumed it might be some mix of flag setting at > system level. If for example i set the extension on an NSFileWrapper to

Re: Sorry to ask again, but maybe I'm asking the question incorrectly. Remote Notifications outside app delegate.

2016-06-04 Thread Alex Zavatone
On Jun 4, 2016, at 4:53 PM, Quincey Morris wrote: > On Jun 4, 2016, at 14:14 , Alex Zavatone wrote: >> >> Currently, the hosting app just needs 1 line of code to start up and use a >> whole app that is within the framework. Not being able to get the APNS >> token within our framework makes i

Re: Sorry to ask again, but maybe I'm asking the question incorrectly. Remote Notifications outside app delegate.

2016-06-04 Thread Alex Zavatone
On Jun 4, 2016, at 3:14 PM, Quincey Morris wrote: > On Jun 4, 2016, at 12:44 , Alex Zavatone wrote: >> >> I'm wondering if (man, I detest the term) method swizzling of the app >> delegate would work or possibly modifying the methods of UIApplication at >> runtime to pipe the methods to a clas

Re: NSDocument not displaying save prompt on dirty document

2016-06-04 Thread livinginlosangeles
Ok. The issue was that the auto-save prompt had disappeared when I was closing a dirty nsdocument. I added a nswindowcontroller to my nsdocument using addWindowController. I needed to add setShouldCloseDocument to my main nswindowcontroller, otherwise my document wouldn’t show the prompt. Patri

Re: NSFileWrapper

2016-06-04 Thread Chris Ridd
> On 4 Jun 2016, at 23:02, Daryle Walker wrote: > >> On Jun 4, 2016, at 12:18 PM, Peter Hudson wrote: >> >> Hi Mike >> >> You're right - I want the behaviour of a package. Do you happen to know how >> I can achieve it? I had presumed it might be some mix of flag setting at >> system level

Re: NSFileWrapper

2016-06-04 Thread Graham Cox
> On 5 Jun 2016, at 8:02 AM, Daryle Walker wrote: > > You have to come up with a new extension. For instance, if you’re already > using “.xyz” for you single-file format, you could use “.xyz-pkg” for your > package format. You can use the same extension and leave it to your app to figure ou

Re: NSFileWrapper

2016-06-04 Thread Peter Hudson
Hi All Many thanks to everyone who has contributed to this thread on NSFileWrapper. I have enough insight now to do some work to see what works. Again, thanks to everybody ! Peter ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do no

Re: NSFileWrapper

2016-06-04 Thread Charles Srstka
> On Jun 5, 2016, at 1:27 AM, Graham Cox wrote: > > >> On 5 Jun 2016, at 8:02 AM, Daryle Walker wrote: >> >> You have to come up with a new extension. For instance, if you’re already >> using “.xyz” for you single-file format, you could use “.xyz-pkg” for your >> package format. > > > You