Subscribe ( )

iPhone Programming Tutorials

 

Forum

If you're new here, you may want to subscribe to my RSS feed. Thanks for visiting!

You must be logged in to post Login Register

Search 

Loading an Image into u r view frm web

User Post

11:30 pm
April 19, 2009


jitesh61

iCoder

posts 9

1

Hi all,

I would like to load an image from net in to my UIImageView.

but the problem is when I run the application, it's not loading/showing the image in my UIImageview and on top  of that the application automatically closes after some time.


This is the code which I have written.


  NSString *urlString = [NSString stringWithFormat:@"website name"];

  url = [NSURL URLWithString:urlString];

  NSLog(@”URL : %@”, url);  // just to check whether it is correct ..

myrequest = [NSURLRequest requestWithURL:url];

NSData *urlData = [[NSData alloc] initWithContentsOfURL:url]; 

myimage = [myimage initWithData:urlData];

myview = [myview initWithImage:myimage];

[self.view addSubview:myview];

myimage nad myview ….. both objects are declared in viewDidLoad method like…
   myimage = [UIImage alloc];
   myview = [UIImageView alloc];
can anyone help me in this …… I m not bale to see any image in my view ……



About the iCodeBlog forum

Currently Online:

3 Guests

Maximum Online: 44

Forums:

Groups: 2

Forums: 6

Topics: 337

Posts: 783

Members:

There are 757 members

There are 1 guests


Brandon has made 87 posts

Top Posters:

bobcubsfan - 54

crazyiez - 30

VertigoSol - 26

AdeC - 17

Uhu - 17

Administrator: Brandon | Moderators: VertigoSol


© - Version 3.1.4 (Build 357)