Am retrieving XML file from the url and i got the images through parsing it. My XML file consists like this,
<Products>
<products id="1">
<img>http://images.com/images/image1.jpg</img>
</products>
<products id="2">
<img>http://images.com/images/image2.jpg</img>
</products>
<products id="3">
<img>http://images.com/images/image3.jpg</img>
</products>
</Products>
The Tableviewcontroller.m has the code like this,
- (void)viewDidLoad{
[super viewDidLoad];
xmlParser = [[XMLParser alloc] loadXMLByURL:@"http://images.com/Products.xml"];
[self.tableView reloadData];}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return [xmlParser.tweets count];}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *CellIdentifier = @"Products";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];}
UIImage *currentTweet = [[xmlParser tweets] objectAtIndex:1];
cell.imageView.image = currentTweet;
[cell.contentView addSubview:self.productImage];
return cell;}
Here xmlParser is the object of class XMLParser and tweets is the array. The product image is reference of the UIImageview.
Now my problem is when i run the app it shows the image in tableview as a thumbnail picture, but i want to show image as the below screenshot i shown.

Also am confused in referencing UIImage view in storyboard, when i define productImage as UIImageView in .h file and try to connect the storyboard it shows me error like Illegal Configuration: Connection “productImage” cannot have a prototype object as its destination. so kindly tell me how to connect it in storyboard too.
Kindly suggest me to solve this,
1 Answer