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 05-18-2011, 12:17 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 6
jowa44 is on a distinguished road
Default Weird crashes when loading an UIImage from a URL

Hi guys,

I'm trying to load a UIImage from an URL with the following code:[html]
Code:
NSString path = @"http://www.wannerbrothers.net/images/header.png";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data];
For some reason, this crashes. But only in specific files. When I create a new view controller, it works, but as soon as I change some other things, it crashes.
As if this weren't strange enough, it works fine approximately every fifth attempt. What could be the problem? Btw, the app crashes due to a SIGABRT.
Thanks in advance!
jowa44 is offline   Reply With Quote
Old 05-18-2011, 12:19 PM   #2 (permalink)
Indie Developer
 
iSDK's Avatar
 
Join Date: Jul 2010
Posts: 1,346
iSDK is on a distinguished road
Send a message via AIM to iSDK
Default

Post to the error stack.

Quote:
Originally Posted by jowa44 View Post
Hi guys,

I'm trying to load a UIImage from an URL with the following code:[html]
Code:
NSString path = @"http://www.wannerbrothers.net/images/header.png";
NSURL *url = [NSURL URLWithString:path];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data];
For some reason, this crashes. But only in specific files. When I create a new view controller, it works, but as soon as I change some other things, it crashes.
As if this weren't strange enough, it works fine approximately every fifth attempt. What could be the problem? Btw, the app crashes due to a SIGABRT.
Thanks in advance!
iSDK is offline   Reply With Quote
Old 05-19-2011, 12:14 AM   #3 (permalink)
Registered Member
 
Join Date: Mar 2011
Posts: 6
jowa44 is on a distinguished road
Default

And where is the error stack?
jowa44 is offline   Reply With Quote
Reply

Bookmarks

Tags
crash, error, uiimage

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: 353
6 members and 347 guests
doffing81, dre, iOS.Lover, Kirkout, PlutoPrime, Wikiboo
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,663
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, LezB44
Powered by vBadvanced CMPS v3.1.0

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