2014-10-06 34 views
0

我正在尋找一種使用代理髮送快速請求以製作viewbot應用的方法。如何有效地做到這一點,或者充分利用代理和網絡能力,任何建議都會非常有用。目前我的設置使用ASIHTTPRequest,我設置一個請求將它添加到一個數組中,然後我有一個不斷循環這些請求和startAsynchronys的方法。快速發送請求時在目標C中使用代理

+1

什麼是 「viewbot」

https://github.com/AndreyLunevich/DLImageLoader-iOS/tree/master/DLImageLoader

示例代碼?? – Fattie 2014-10-14 09:30:58

+0

如果您已經聽說過twitch.tv,它實質上是讓您看起來像在同一時間有很多觀衆一樣,但實際上並非如此。如果您已經有了基線觀衆,那麼您可以根據觀衆獲得「精選」,如果這樣做有意義,則會有更多真實觀衆觀看。 – Charlie 2014-10-15 16:34:26

+0

哦,我明白了。但你想要在APP上做到這一點。這是你正在抓取的圖像嗎? – Fattie 2014-10-15 16:40:42

回答

1

你可以簡單地使用DLImageLoager,它會照顧所有人嗎?

這是一個難以置信的維護良好的圖書館。我們經常用它來疊加100個電話,而不是一個呃逆。爲 「設置和忘記」 加載圖像

-(UICollectionViewCell *)collectionView:(UICollectionView *)cv 
     cellForItemAtIndexPath:(NSIndexPath *)indexPath 
    { 
    NSInteger thisRow = indexPath.row; 
    BooksCell *cell; 
    cell = [cv dequeueReusableCellWithReuseIdentifier: 
       @"CellBooksNormal" forIndexPath:indexPath]; 

    cell.layer.shouldRasterize = YES; 
    cell.layer.rasterizationScale = [UIScreen mainScreen].scale; 

    // set text items... 
    cell.title = @"blah"; 

    // set image items using DLImageLoader 

    __weak UIBookView *loadMe = cell.anImage; 
    [DLImageLoader loadImageFromURL:imUrl 
     completed:^(NSError *error, NSData *imgData) 
     { 
     [loadMe use:[UIImage imageWithData:imgData]]; 
     }]; 

    return cell; 
    }