Images in Uiscroll cell populated by mysql database

吃可爱长大的小学妹 提交于 2019-12-02 12:49:04

问题


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

来源:https://stackoverflow.com/questions/10859728/images-in-uiscroll-cell-populated-by-mysql-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!