Subscribe ( )

iPhone Programming Tutorials


 

Forum

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 12

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 ……


Search 

About the iCodeBlog forum

Most Users Ever Online:

44


Currently Online:

5 Guests

Forum Stats:

Groups: 2

Forums: 6

Topics: 419

Posts: 893

Membership:

There are 934 Members

There has been 1 Guest

There are 2 Admins

There is 1 Moderator

Top Posters:

bobcubsfan – 54

crazyiez – 30

Uhu – 17

AdeC – 17

Nick – 15

jitesh61 – 12

Administrators: Brandon (88 Posts), Collin (0 Posts)

Moderators: VertigoSol (26 Posts)



©   

  • Posted by on 6 Aug 2008 in Uncategorized
  •   |  
  •   |  
  •   |  
  • Comments Off

Comments are closed.