Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 01-22-2011, 10:06 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 1
lukakiarelli is on a distinguished road
Unhappy Problem with NSKeyedUnarchiver memory leak

Hi there,

I have been spending some time to solve this problem I have in my code. In my Sql storage class I have two methods which I use to encode and decode one single big object.

- (NSData*) encodeWithDataNSArray*)data keyNSString*)key
{
NSLog(@"encoding data for key: %@", key);

NSData* archivedData = [NSKeyedArchiver archivedDataWithRootObject:data];

}

- (NSArray*) decodeWithDataNSData*)data keyNSString*)key
{
NSLog(@"decoding data for: %@", key);

NSArray* unarchivedData = (NSArray*)[NSKeyedUnarchiver unarchiveObjectWithData:data];

return unarchivedData;


The code works just fine, but in the Instrument "Leak" tool reveals a leak everytime this method is called.

I tried different options, but nothing have worked so far.

Can anybody help me please?

Thx
lukakiarelli is offline   Reply With Quote
Old 01-22-2011, 10:09 AM   #2 (permalink)
Reading the Documentation
 
baja_yu's Avatar
 
Join Date: Sep 2010
Location: 45.255019,19.844908
Posts: 5,414
baja_yu has a spectacular aura about
Default

Instruments will point to the place where the object was created. You may be leaking it somewhere else. Are you retaining the return values of those methods somewhere and not releasing them?
baja_yu is offline   Reply With Quote
Reply

Bookmarks

Tags
leak, memory, nskeyedunarchiver

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 358
10 members and 348 guests
7twenty7, dre, iAppDeveloper, jeroenkeij, Mah6447, Morrisone, sacha1996, Sami Gh, stanny, toon4413
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:42 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0