Re: Unarchiving issues

2010-08-02 Thread James Maxwell
Thanks, everybody. Of course, you're all absolutely right, the buffer from decodeBytesForKey is temporary. I'd just assumed the bytes would be written to my malloced buffer, not realizing I needed to explicitly copy them. Problem solved. cheers, J. On 2010-08-02, at 10:56 AM, Graham Cox wrote

Re: Unarchiving issues

2010-08-02 Thread glenn andreas
On Aug 2, 2010, at 12:46 PM, James Maxwell wrote: > // set the contents of the array > continuations = (float*)[aDecoder > decodeBytesForKey:@"continuations" returnedLength:&size]; >From the header file: - (const uint8_t *)decodeBytesForKey:(NSString *)key returne

Re: Unarchiving issues

2010-08-02 Thread Graham Cox
On 03/08/2010, at 3:46 AM, James Maxwell wrote: > continuations = (float*)[aDecoder > decodeBytesForKey:@"continuations" returnedLength:&size]; I expect the returned bytes are autoreleased. The docs don't state this explicitly, but the similar method -decodeBytesWithReturnedLeng

Re: Unarchiving issues

2010-08-02 Thread James Maxwell
Okay, so here's the initWithCoder from the object that's giving me grief. The variable "continuations" is a float* array, and appears to load fine from here, but disappears once the root object is unarchived and set. I've since discovered that, through a mistake I made at another place in the co

Re: Unarchiving issues

2010-08-01 Thread Michael Ash
On Sun, Aug 1, 2010 at 3:30 PM, James Maxwell wrote: > Hello All, > > I have a strange problem with NSKeyedArchiver/Unarchiver. I have a very > complex object graph that I want to be persistent, independently of my > document objects, so I'm archiving it into the user's application support > fo

Re: Unarchiving issues

2010-08-01 Thread Quincey Morris
On Aug 1, 2010, at 13:31, James Maxwell wrote: > heh... yeah, that's true. But the thing is I haven't done anything different > with this particular float* array. It's the same type of archiving I've used > at many points in the app. > But I hadn't thought to look for weak references could

Re: Unarchiving issues

2010-08-01 Thread James Maxwell
heh... yeah, that's true. But the thing is I haven't done anything different with this particular float* array. It's the same type of archiving I've used at many points in the app. But I hadn't thought to look for weak references could this be as simple as making sure to type cast objects w

Re: Unarchiving issues

2010-08-01 Thread Quincey Morris
On Aug 1, 2010, at 12:30, James Maxwell wrote: > What I don't understand is how the Hierarchy can be fine at the end of the > Network's initWithCoder method, but then get banjaxed somehow after that. Sure you do. Things disappear suddenly when not retained or strongly referenced. You're descri

Unarchiving issues

2010-08-01 Thread James Maxwell
Hello All, I have a strange problem with NSKeyedArchiver/Unarchiver. I have a very complex object graph that I want to be persistent, independently of my document objects, so I'm archiving it into the user's application support folder. The root object for the archive is a class called Network,