Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-08-2009, 10:29 AM   #3 (permalink)
teras
Registered Member
 
Join Date: Aug 2008
Posts: 17
Default

I have some problems with memory management.

I thought to use the init- messages instead, like this:
Code:
	NSData * data = [[NSData alloc] initWithContentsOfURL:[NSURL URLWithString:myURL]];
	UIImage *img = [[UIImage alloc] initWithData:data];
	[myImageView setImage:img];
	[img dealloc];
	[data dealloc];
If I use it like this, when code reaches [data dealloc] it segfaults.

Why is this happening?
teras is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,272
Threads: 39,066
Posts: 171,312
Top Poster: smasher (2,575)
Welcome to our newest member, monady754
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 10:50 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.