FROM : Markus Spoettl
DATE : Sun May 18 19:04:47 2008
On May 18, 2008, at 5:25 AM, Klaus Backert wrote:
>> - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName
>> error:(NSError **)outError
>> {
>> *outError = nil;
>> NSKeyedUnarchiver *archiver;
>> archiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:
>> data];
>>
>> // release current data
>> [tracks release];
>> tracks = [archiver decodeObjectForKey: @"myobject"];
>> [tracks retain];
>
> may be because this is missing:
>
> [archiver finishDecoding];
That wasn't it but thanks for helping.
The real reason was that I forgot to retain the objects decoded in
tracks:initWithCoder: after decoding, so instead of
timeStamp = [[decoder decodeObjectForKey:@"timeStamp"] retain];
I had
timeStamp = [decoder decodeObjectForKey:@"timeStamp"];
and apparently the NSKeyedUnarchiver was the only think keeping that
data alive.
Well, I apologize for wasting your time.
Regards
Markus
--
DATE : Sun May 18 19:04:47 2008
On May 18, 2008, at 5:25 AM, Klaus Backert wrote:
>> - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName
>> error:(NSError **)outError
>> {
>> *outError = nil;
>> NSKeyedUnarchiver *archiver;
>> archiver = [[NSKeyedUnarchiver alloc] initForReadingWithData:
>> data];
>>
>> // release current data
>> [tracks release];
>> tracks = [archiver decodeObjectForKey: @"myobject"];
>> [tracks retain];
>
> may be because this is missing:
>
> [archiver finishDecoding];
That wasn't it but thanks for helping.
The real reason was that I forgot to retain the objects decoded in
tracks:initWithCoder: after decoding, so instead of
timeStamp = [[decoder decodeObjectForKey:@"timeStamp"] retain];
I had
timeStamp = [decoder decodeObjectForKey:@"timeStamp"];
and apparently the NSKeyedUnarchiver was the only think keeping that
data alive.
Well, I apologize for wasting your time.
Regards
Markus
--
| Related mails | Author | Date |
|---|---|---|
| Markus Spoettl | May 18, 09:51 | |
| Klaus Backert | May 18, 14:25 | |
| Markus Spoettl | May 18, 19:04 | |
| Jonathan Dann | May 18, 22:53 | |
| Markus Spoettl | May 19, 03:54 |






Cocoa mail archive

