Images in Uiscroll cell populated by mysql databas

2019-02-28 09:12发布

问题:

I am stuck somewhere,

I am dynamically pulling images from MYSQL database using PHP, that is all ok until I reach the point of retrieving the names of the photo from the URL. I want to dynamically insert thumbnails on UIScroll View so that users can scroll horizontally to view all the images, description of the photos, summary of the photos, I would also like them to click and open more details

Here is my code so far

-(void)getItems 
{
    NSString *root = URL

    NSURL *url = [NSURL URLWithString:[NSString stringWithFormat:@"%@/phpfile", root]];

    NSURLRequest *request = [NSURLRequest requestWithURL:url];

    AFJSONRequestOperation *operation = [AFJSONRequestOperation JSONRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id JSON) 
    {
        [self.object removeAllObjects];

        id results = [JSON valueForKeyPath:@"ids"];

        [results enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) 
        {
            [self.object addObject:[NSString stringWithFormat:@"%@",[obj valueForKey:@"item1"]]];
            [self.object2 addObject:[NSString stringWithFormat:@"%@",[obj valueForKey:@"item2"]]];



-(void)DidLoad
{
    //initializing arrays to hold data

    //Initiate arrays that hold data
    object1 = [[NSMutableArray alloc] init];
    object2 = [[NSMutableArray alloc] init];

I need to display object 1, on a horizontal UIscroll so that users can scroll to see more thumbnails,(as well as names and descriptions) on click, the (UIscroll view should open detailed info)

all these information will be extracted from the database