tags:

views:

30

answers:

1

i am loading several images based on when user click any row -> section ->images

i am parsing via NSxmlparser now point is i can only go to detail section if all of my images loaded which is too time consuming is there any way that allow me to go to section view(even if 1 image loaded) and then keep loading rest images later

this is my parser code

if([elementName isEqualToString:@"result"]) {

    //  NSLog(@" ADD f  ELEMENT");
        [appDelegate.aGallry addObject:aGall];
        NSLog(@"Processing new  Value: %@", currentElementValue);

        //[aGall release];

        NSUserDefaults *img = [NSUserDefaults standardUserDefaults];
        [img setObject:currentElementValue forKey:@"keyToimg"];
        //aDetail= nil;


        NSLog(@"table count is %i",[appDelegate.aGallry count]);




    }

this is to retrieve

    NSUserDefaults *imgg = [NSUserDefaults standardUserDefaults];
    NSString *myimg= [imgg stringForKey:@"keyToimg"];
//XMLAppDelegate*   appDelegate=(XMLAppDelegate*)[UIApplication sharedApplication].delegate;
    //NSString *myimg=aGall.images;
    NSLog(@"RES image sssssssss  is = %@",myimg);



    NSString *trimmedString1 = [myimg stringByTrimmingCharactersInSet:
                                [NSCharacterSet whitespaceAndNewlineCharacterSet]];


NSLog(@"trrimming is  %@",trimmedString1);



    /// puttint them to araay


    NSMutableArray  *a1 = [[NSMutableArray alloc] init];
[a1 addObjectsFromArray:[trimmedString1 componentsSeparatedByString:@"\n\t"]];

    [a1 addObject:trimmedString1];
A: 

You will probably want to use an NSOperationQueue. Lecture 10 of Stanford iPhone programming course should help you in implementing it.

Rudiger