Re: mmap quiet failure - all reads are 0x00

2016-02-05 Thread Michael David Crawford
Perhaps it is a bug unrelated to mmap, that screws up some of your state, then later it causes the mmap to fail. Or perhaps the mmap succeeds, but the bytes your are reading are coming from some other place. There are many debugging techniques, such as using assertions, guard malloc etc. But don

Re: WebViews and the Java Plugin

2016-02-05 Thread Sandor Szatmari
Jens, Thanks for the perspective here. On Feb 5, 2016, at 7:32 PM, Jens Alfke wrote: > >> On Feb 5, 2016, at 5:02 AM, Sandor Szatmari >> wrote: >> >> Has anyone had any success running Java applets in a WebView? > > FYI, Java applets are being deprecated and developers are urged to stop

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jens Alfke
> On Feb 5, 2016, at 9:00 AM, Dave wrote: > > self.pNetworkNodeChildArray = [[NSMutableArray alloc] initWithArray:myArray > copyItems:YES]; > > and that should be - copyItems:NO Or just myArray.mutableCopy … —Jens ___ Cocoa-dev mailing list (Cocoa

Re: mmap quiet failure - all reads are 0x00

2016-02-05 Thread Jens Alfke
> On Feb 5, 2016, at 10:09 AM, Trygve Inda wrote: > > It seems like no matter what is in the mmap file, when I read from it I get > 0x00 for every byte and no error or exception is generated. I can't > reproduce it as it is very random. Quitting and relaunching solves it. That sounds strange to

Re: WebViews and the Java Plugin

2016-02-05 Thread Jens Alfke
> On Feb 5, 2016, at 5:02 AM, Sandor Szatmari > wrote: > > Has anyone had any success running Java applets in a WebView? FYI, Java applets are being deprecated and developers are urged to stop using them: "With modern browser vendors working to restrict and reduce plugin support in their

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Graham Cox
> On 6 Feb 2016, at 4:00 AM, Dave wrote: > > self.pNetworkNodeChildArray = [[NSMutableArray alloc] initWithArray:myArray > copyItems:YES]; This is one reason why sometimes having explicit ivars for key parts of an object will save you many hours of trouble. If you had e.g: @synthesize pNet

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Alex Zavatone
On Feb 5, 2016, at 12:01 PM, Dave wrote: >> >> Would something that is the opposite of strongify/weakify work here? Sort >> of a strongify a weak reference when it comes to archiving and archive the >> strong reference? > > Sort of a Quantum reference! > >> That almost sounds crazy enough

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Alex Zavatone
Sure. That would be nice. I also recall some classes for archiving and dearchiving that use introspection that automatically handle the proper action in one line of code. For simple cases with straightforward collection classes, this is a really really really nice approach and frees us from ha

Re: Archive/Unarchive Problem - Bug in MacOSX/Cocoa?

2016-02-05 Thread Dave
> On 5 Feb 2016, at 16:10, Keary Suska wrote: > > >> On Feb 5, 2016, at 8:45 AM, Dave wrote: >> >> Hi All, >> >> I have written a Test App that demonstrates the problem, please let me know >> if you’d like a copy. >> >> I’m not sure if its a bug or not and if not a bug then how to make it

mmap quiet failure - all reads are 0x00

2016-02-05 Thread Trygve Inda
I have image data that is stored in a 150mb file which I use mmap to read. The image data is pulled into a NSBitmapImageRep pixel by pixel and eventually shows on the screen. Only a subset of the pixel in the mmap file are pulled into a single NSBitmapImageRep. A few customers (and I have seen it

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Dave
> On 5 Feb 2016, at 17:04, Quincey Morris > wrote: > > On Feb 5, 2016, at 07:27 , Dave > wrote: >> >> If you set it strong, then it creates a dupe of the object over and over >> again, as I said in the other thread > > a. If that’s the case, then your problem

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Quincey Morris
On Feb 5, 2016, at 07:27 , Dave wrote: > > If you set it strong, then it creates a dupe of the object over and over > again, as I said in the other thread a. If that’s the case, then your problem is nothing to do with the weak references. Something is causing those objects to be *either* archi

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Dave
> > Would something that is the opposite of strongify/weakify work here? Sort of > a strongify a weak reference when it comes to archiving and archive the > strong reference? Sort of a Quantum reference! > That almost sounds crazy enough to work. So do Quantum computers! __

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Dave
Hi Alex, Found it! Well, Jean-Daniel did - Thanks again! I was barking up the wrong tree thinking it was the back links that were the problem. Using weak caused them to (correctly as it turned out) be set to nil when the node it reference is released. The problem was in the initWithCoder metho

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Alex Zavatone
On Feb 5, 2016, at 8:46 AM, Dave wrote: > >> On 5 Feb 2016, at 13:34, Jean-Daniel Dupas wrote: >> >> And obviously, you also add - encodeWithCoder: and -initWithCoder: methods >> in your custom classes. > > Yes, see my other thread, it decodes all the other fields but not the (weak) > back

Re: Archive/Unarchive Problem - Bug in MacOSX/Cocoa?

2016-02-05 Thread Keary Suska
> On Feb 5, 2016, at 8:45 AM, Dave wrote: > > Hi All, > > I have written a Test App that demonstrates the problem, please let me know > if you’d like a copy. > > I’m not sure if its a bug or not and if not a bug then how to make it work. > Everyone keeps telling me its possible but no one se

Re: WebViews and the Java Plugin

2016-02-05 Thread Sandor Szatmari
Thanks for the link Tamas. I'll check it out and let you know if I have success. Sandor Szatmari > On Feb 5, 2016, at 08:08, Tamas Nagy wrote: > > Hi Sandor, > > you might need to enable the Java plugin on 10.10: > https://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit

Re: Archive/Unarchive Problem - Bug in MacOSX/Cocoa?

2016-02-05 Thread Dave
Hi All, I have written a Test App that demonstrates the problem, please let me know if you’d like a copy. I’m not sure if its a bug or not and if not a bug then how to make it work. Everyone keeps telling me its possible but no one seems to know how to make it work. According to the (few) doc

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Dave
> On 5 Feb 2016, at 15:07, Jean-Daniel Dupas wrote: > > Maybe an issue cause you use __weak reference which zeroed for some reason. > Can you try to use __unsafe_unretained instead and see what happen ? If you look on my other thread, you will see that I have tried this, if I use “assign” or _

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jean-Daniel Dupas
Maybe an issue cause you use __weak reference which zeroed for some reason. Can you try to use __unsafe_unretained instead and see what happen ? > Le 5 févr. 2016 à 14:46, Dave a écrit : > > >> On 5 Feb 2016, at 13:34, Jean-Daniel Dupas wrote: >> >> And obviously, you also add - encodeWithCod

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Dave
> On 5 Feb 2016, at 13:34, Jean-Daniel Dupas wrote: > > And obviously, you also add - encodeWithCoder: and -initWithCoder: methods in > your custom classes. Yes, see my other thread, it decodes all the other fields but not the (weak) back links get set to nil most of the time……. _

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Dave
Hi, > On 5 Feb 2016, at 13:37, Alex Zavatone wrote: > > The first question is, “Do you have any circular references?” See my other thread for answer to that, but no, its a network with a Root Object and Child Objects, similar to a NSViewController/NSView Hierarchy. So, no there are no circula

Archive/Unarchive Problem - Bug in MacOSX/Cocoa?

2016-02-05 Thread Dave
Hi, I hoped that someone might have had some ideas on why back links are not working when Archiving/Unarchiving objects. I’ve searched for documentation and sample code that shows using a back-link like this but can’t find anything that says categorically that it should work and nothing that sa

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Alex Zavatone
The first question is, “Do you have any circular references?” On Feb 5, 2016, at 8:13 AM, Dave wrote: > Hi, > > I’m having problems with Back Links when Archiving/Unarchiving an Object. I > found the text below at: > > https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Arc

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jean-Daniel Dupas
And obviously, you also add - encodeWithCoder: and -initWithCoder: methods in your custom classes. > Le 5 févr. 2016 à 14:33, Jean-Daniel Dupas a écrit : > > That is your need, not your problem. > > To archive an object graph (cyclic or not), you just do [NSKeyedArchiver > archiveRootObject:

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jean-Daniel Dupas
That is your need, not your problem. To archive an object graph (cyclic or not), you just do [NSKeyedArchiver archiveRootObject:graph toFile:@"myfile"]; > Le 5 févr. 2016 à 14:28, Dave a écrit : > > Hi, > > See my other thread on this list which explains it fully - > "Archive/Unarchive P

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Dave
Hi, See my other thread on this list which explains it fully - "Archive/Unarchive Problem/Question?”. Basically I need to save/restore a Network of Custom Objects….. All the Best Dave > On 5 Feb 2016, at 13:18, Jean-Daniel Dupas wrote: > > You don’t tell use what is your problem. You can pe

Re: Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Jean-Daniel Dupas
You don’t tell use what is your problem. You can perfectly encode any structure using Keyed archivers (whether there is cycles and backlinks). > Le 5 févr. 2016 à 14:13, Dave a écrit : > > Hi, > > I’m having problems with Back Links when Archiving/Unarchiving an Object. I > found the text bel

Question about Archives and Serialisations Programming Guide

2016-02-05 Thread Dave
Hi, I’m having problems with Back Links when Archiving/Unarchiving an Object. I found the text below at: https://developer.apple.com/library/mac/documentation/Cocoa/Conceptual/Archiving/Articles/archives.html Root Object An object graph is not necessarily a simple tree structure. Two objects

Re: WebViews and the Java Plugin

2016-02-05 Thread Tamas Nagy
Hi Sandor, you might need to enable the Java plugin on 10.10: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/WebKit/Classes/WebPreferences_Class/index.html#//apple_ref/occ/instp/WebPreferences/javaEnabled

WebViews and the Java Plugin

2016-02-05 Thread Sandor Szatmari
Has anyone had any success running Java applets in a WebView? We have an in house app that has successfully loaded and run Java applets up until SDK 10.6, but after that (tested up to 10.10) Java applets simply do not load. I have created bare bones test apps with regular WebViews and WKWebVi

Re: Protocol extensions returning self

2016-02-05 Thread Jan E. Schotsman
On Feb 4, 2016, at 4:56 PM, Charles Jenkins wrote: Supposedly in a protocol, “Self” is the class implementing the protocol. So it seems to me that extension methods should be able to have a return type of Self so they can return self, and thus have the extension method behave the same as i