Re: RunLoop in Helper Tool

2013-09-16 Thread Uli Kusterer
On 16 Sep 2013, at 01:10, Greg Parker gpar...@apple.com wrote: And of course every Cocoa app halts by calling exit(). NSApplicationMain() never returns. (I'm pretty sure it doesn't attempt to stop the main run loop, either.) It does go and close all documents and send

Very strange Xpc magic

2013-09-16 Thread Gerriet M. Denkmann
In a new app (not document based) I inserted: #import ZipProtocol.h // ZipProtocol.h: @protocol ZipProtocol NSObject - (void)command:(NSString *)command withReply: (void (^)( NSString *answerString ))reply; @end #define MAGIC_BUG_REMOVAL // defined or not - makes a

Re: Window controllers and memory leaks

2013-09-16 Thread Jonathan Taylor
Thanks Kyle and Jerry. It feels a bit strange to be adding extra glue code to track otherwise-completely-autonomous windows (and controllers), but that has certainly done the trick. I found the static analyzer a bit odd to get used to - it sometimes gives purportedly very detailed

Re: Confusion about Image I/O export?

2013-09-16 Thread Uli Kusterer
On 02 Sep 2013, at 18:42, Graham Cox graham@bigpond.com wrote: Maybe more education is needed but we thought we had explained all that. Maybe we need to display the calculated pixel sizes up front so the user doesn't get surprised by the outcome. I’d go with the latter. If a popular app

Re: NSTabView

2013-09-16 Thread Joseph Ayers
I'm writing a signal processing program and I am trying to use a window to display multiple NSViews of an oscilloscope, histograms, etc. I create the NSTabViewItems programmatically. The window controller declares the following properties: @property(nonatomic, strong) IBOutlet NSWindow

UIView Center does not seem to change with orientation change

2013-09-16 Thread Rich Collyer
I am looking at at view that covers the entire iPhone screen. The app is also required to only work in Landscape. I see that in viewWillAppear the bounds and center of the view are in Portrait mode - this is fine. However, in viewDidAppear the bounds of the view are in Landscape, but the center

Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Brian Clark
I'm hoping someone can suggest the correct way to deal with the following problem. For an image viewing app i display a file in the usual way in an NSDocument. setFileURL: is properly called by NSDocument's _initWithContentsOfURL:ofType:error:. I now want to display the next file in the

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Mike Abdullah
On 14 Sep 2013, at 21:14, Brian Clark ba-cl...@comcast.net wrote: I'm hoping someone can suggest the correct way to deal with the following problem. For an image viewing app i display a file in the usual way in an NSDocument. setFileURL: is properly called by NSDocument's

Re: RunLoop in Helper Tool

2013-09-16 Thread Marcel Weiher
On Sep 16, 2013, at 9:12 , Uli Kusterer witness.of.teacht...@gmx.net wrote: On 16 Sep 2013, at 01:10, Greg Parker gpar...@apple.com wrote: And of course every Cocoa app halts by calling exit(). NSApplicationMain() never returns. (I'm pretty sure it doesn't attempt to stop the main run

Progress for archiving/dearchiving

2013-09-16 Thread Graham Cox
Hi all, If I wanted to add some sort of progress reporting to archiving and dearchiving, what's a good way to do it? The problem seems to me to know what the 'count' of things read from/written to the file is to set the progress max value. Since the delegate gets called for each object

Re: Progress for archiving/dearchiving

2013-09-16 Thread Chris Devereux
How about tracking the number of written objects when saving the document, then encoding an additional key containing the object count at the top level of the archive? This could then be retrieved before decoding the root object. A possible problem with this idea is that it might require the data

Re: UIView Center does not seem to change with orientation change

2013-09-16 Thread David Duncan
On Sep 13, 2013, at 1:27 PM, Rich Collyer iseecol...@rsqrdc.us wrote: I am looking at at view that covers the entire iPhone screen. The app is also required to only work in Landscape. I see that in viewWillAppear the bounds and center of the view are in Portrait mode - this is fine.

Re: Very strange Xpc magic

2013-09-16 Thread Gerriet M. Denkmann
On 16 Sep 2013, at 22:10, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 16, 2013, at 3:22 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: In a new app (not document based) I inserted: #import ZipProtocol.h // ZipProtocol.h: @protocol ZipProtocol NSObject -

Re: Very strange Xpc magic

2013-09-16 Thread Charles Srstka
On Sep 16, 2013, at 3:22 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: ree = [ aCo remoteObjectProxyWithErrorHandler: ^(NSError *err) { // if helperName is not running (always the case) and

Re: Very strange Xpc magic

2013-09-16 Thread Keary Suska
On Sep 16, 2013, at 9:27 AM, Gerriet M. Denkmann wrote: On 16 Sep 2013, at 22:21, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 16, 2013, at 10:16 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: If (and only if) MAGIC_BUG_REMOVAL is defined, I see: Error

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Brian Clark
On Sep 16, 2013, at 4:38 AM, Mike Abdullah mabdul...@karelia.com wrote: On 14 Sep 2013, at 21:14, Brian Clark ba-cl...@comcast.net wrote: I'm hoping someone can suggest the correct way to deal with the following problem. For an image viewing app i display a file in the usual way in an

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Kyle Sluder
On Sat, Sep 14, 2013, at 01:14 PM, Brian Clark wrote: I'm hoping someone can suggest the correct way to deal with the following problem. For an image viewing app i display a file in the usual way in an NSDocument. setFileURL: is properly called by NSDocument's

Re: Very strange Xpc magic

2013-09-16 Thread Charles Srstka
On Sep 16, 2013, at 10:27 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: Maybe I was not very clear. The problem is NOT that the helper app does not start. There just is no helper app, there is nothing which has a MachService called something.very.silly. The problem is, that the

NSCollectionView item crashes when bound

2013-09-16 Thread Benjamin Rindt
Hey guys I'm really grinding with the NSCollectionView when its bound. I had a running collection view but wanted to use bindings, I looks like it should work, but it doesn't. This is written just in code not in IB. Hope you guys can help :) The problem is, the View is displayed

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Kevin Perry
Re-using a single NSDocument instance to represent several different files is certainly atypical… But, I suspect the problem here is that you're not using File Coordination when reading in the contents of the new file. By not doing that, you're not giving File Coordination the hint that it

Re: Progress for archiving/dearchiving

2013-09-16 Thread Graham Cox
On 16/09/2013, at 8:08 PM, Jeffrey Oleander jgo...@yahoo.com wrote: Yes, of course, you can. But that is too late. You need to know the total, the max, before you display the progress bar Ah, true but in fact displaying progress when dearchiving is more important. Documents get saved in

Re: Progress for archiving/dearchiving

2013-09-16 Thread Graham Cox
On 16/09/2013, at 6:51 PM, Jeffrey Oleander jgo...@yahoo.com wrote: I'll bite. If you want to know the total number of objects to be archived, then you need to count them, at some time or another. To count them, you need to walk the object tree before you start actually archiving...

Re: Unwanted presentedItemDidMoveToURL: for old file after using setFileURL: to specify a new file

2013-09-16 Thread Brian Clark
On Sep 16, 2013, at 12:24 PM, Kevin Perry kpe...@apple.com wrote: Re-using a single NSDocument instance to represent several different files is certainly atypical… True, and I don't know what other similar applications so, but for some applications that are viewers it makes sense to let the

Re: Progress for archiving/dearchiving

2013-09-16 Thread Chris Devereux
Another angle worth looking at: Depending on the output format you're using with NSKeyedArchiver, your file might already contain an object count, even if the API doesn't expose it. According to the Cocotron source[1], the binary plist format actually does this. It won't correspond exactly to the

Re: Very strange Xpc magic

2013-09-16 Thread Gerriet M. Denkmann
On 16 Sep 2013, at 22:13, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 16, 2013, at 3:22 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: ree =[ aCo remoteObjectProxyWithErrorHandler: ^(NSError *err) { //

Re: Very strange Xpc magic

2013-09-16 Thread Charles Srstka
On Sep 16, 2013, at 10:16 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: If (and only if) MAGIC_BUG_REMOVAL is defined, I see: Error Domain=NSCocoaErrorDomain Code=4099 Couldn’t communicate with a helper application. Makes sense, as there just is no helper application named:

Re: Progress for archiving/dearchiving

2013-09-16 Thread Graham Cox
On 16/09/2013, at 4:25 PM, Chris Devereux devereux.ch...@gmail.com wrote: How about tracking the number of written objects when saving the document, then encoding an additional key containing the object count at the top level of the archive? This could then be retrieved before decoding the

Re: Very strange Xpc magic

2013-09-16 Thread Gerriet M. Denkmann
On 16 Sep 2013, at 22:21, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 16, 2013, at 10:16 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: If (and only if) MAGIC_BUG_REMOVAL is defined, I see: Error Domain=NSCocoaErrorDomain Code=4099 Couldn’t communicate with a helper

Re: Very strange Xpc magic

2013-09-16 Thread Gerriet M. Denkmann
On 16 Sep 2013, at 23:16, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 16, 2013, at 10:27 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: Maybe I was not very clear. The problem is NOT that the helper app does not start. There just is no helper app, there is nothing which

Re: Very strange Xpc magic

2013-09-16 Thread Gerriet M. Denkmann
On 16 Sep 2013, at 23:13, Keary Suska cocoa-...@esoteritech.com wrote: On Sep 16, 2013, at 9:27 AM, Gerriet M. Denkmann wrote: On 16 Sep 2013, at 22:21, Charles Srstka cocoa...@charlessoft.com wrote: On Sep 16, 2013, at 10:16 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: If

Re: Very strange Xpc magic

2013-09-16 Thread Charles Srstka
On Sep 16, 2013, at 11:33 AM, Gerriet M. Denkmann gerr...@mdenkmann.de wrote: I also did some more testing. The magic does not lie in the NSLog() but in the elapsed time. On my machine the sending of a message to remoteObjectProxy must NOT be done earlier than ca. 180 μsec after

Re: Progress for archiving/dearchiving

2013-09-16 Thread Jeffrey Oleander
On 2013 Sep 16, at 08:53, Graham Cox wrote: If I wanted to add some sort of progress reporting to archiving and dearchiving, what's a good way to do it? The problem seems to me to know what the 'count' of things read from/written to the file is to set the progress max value. Since the delegate

Re: Progress for archiving/dearchiving

2013-09-16 Thread Gerriet M. Denkmann
On 17 Sep 2013, at 00:26, Graham Cox graham@bigpond.com wrote: What I was sort of hoping was that there was a way to figure out from the archive how many objects there were without having to archive the number explicitly. For example, the root level of an archive is a dictionary,