Note that there are some explanatory texts on larger screens.

plurals
  1. POhow can i display new images at the top of the table view
    primarykey
    data
    text
    <p>i am getting images from the .net web server by passing xml parameters.</p> <p>i am getting more that 20 images and i am saving images in iphone simulator documents one by one like this.</p> <pre><code>-(void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName { if( [elementName isEqualToString:@"photo"]) { recordResults_photo = FALSE; NSData *decode = [Base64 decode:resultData_photo]; NSString *theXML = [[NSString alloc] initWithData:decode encoding:NSUTF8StringEncoding]; NSData *decodedimage = [Base64 decode:theXML]; UIImage *image = [UIImage imageWithData:decodedimage]; NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSLog(@"saving msg image %d",i); NSString *pngFilePath = [NSString stringWithFormat:@"%@/image%d.png",docDir,i]; NSData *data1 = [NSData dataWithData:UIImagePNGRepresentation(image)]; [data1 writeToFile:pngFilePath atomically:YES]; } } </code></pre> <p>then images are saving like this image0.png,image1.png,image2.png.....</p> <p>and i am displaying these images in table view like this. </p> <pre><code>NSString *docDir = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *pngFilePath = [NSString stringWithFormat:@"%@/image%d.png",docDir,indexPath.row]; UIImageView *img = [[UIImageView alloc]initWithFrame:CGRectMake(250, 05, 30, 30)]; img.image = [UIImage imageWithContentsOfFile:pngFilePath]; [cell.contentView addSubview:img]; </code></pre> <p>then images are displayed well.</p> <p>But now i have a problem here.</p> <p>I am getting some more new images from the web server and i need to display them at the top of the table view.</p> <p>As per my implementation i need to change all the image names.</p> <p>That's not the proper way,is there any alternate way or better way than me.</p> <p>can any one please help me.</p> <p>Thank u in advance </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload