views:

1156

answers:

3

Hi,

this is the code, which might be cause to generate this exception

NSURL *justURL = [NSURL URLWithString:wJustUrl];//wJustUrl declared in constant file.
//NSURL *justURL = [[NSURL alloc] initWithString:wJustUrl];
NSLog(@"%@",justURL);
//self.justArray = [[NSArray alloc] initWithContentsOfURL:justURL];
self.justArray = [NSArray arrayWithContentsOfURL:justURL];
NSLog(@"%@", justArray);

and this is consol log

2008-12-06 18:09:21.602 XYZ[4309:4a03] *** -[CFURL release]: message sent to deallocated instance 0x1049730

[Session started at 2008-12-06 18:09:21 +1100.]
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40 UTC 2008)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are welcome  to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-apple-darwin".warning: Unable to read symbols for "/System/Library/Frameworks/UIKit.framework/UIKit" (file not found).
warning: Unable to read symbols from "UIKit" (not yet mapped into memory).
warning: Unable to read symbols for "/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics" (file not found).
warning: Unable to read symbols from "CoreGraphics" (not yet mapped into memory).
warning: Unable to read symbols for "/System/Library/Frameworks/MediaPlayer.framework/MediaPlayer" (file not found).
warning: Unable to read symbols from "MediaPlayer" (not yet mapped into memory).
Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/TR/Library/Application Support/iPhone Simulator/User/Applications/9CD50618-72D7-462A-88F7-59C48417D30D/ABC.app/ABC', process 4309.
[Switching to process 4309 thread 0x4a03]
[Switching to process 4309 thread 0x20b]
[Switching to process 4309 thread 0x20b]

I Activated the NSZombieEnabled facility in my project, and I come to know that's I m sending message to deallocated instace.but I didn't deallocated any resource.

plz help me to come out of this .

cheers

+1  A: 

Just a shot in the dark (haven't bothered to test how it would behave), but are you certain that -URLWithString: is returning a value? Are you seeing the URL in the log after the NSLog?

If -URLWithString: doesn't like the URL (for example, if there's a space in it) then it will return a nil value, which -arrayWithContentsOfURL: might not like.

Dave Batton
+2  A: 

Are you calling [justURL release] anywhere? You shouldn't, since it is autoreleased for you...

Kendall Helmstetter Gelner
A: 

I did the exact same thing, e.g. calling [justURL release].. commented that and voila!

Kian Cheong