我是iPhone開發新手。 我在view.also上顯示了很多圖像,並且我將更多圖像命名爲LOAD MORE按鈕。我也正在LOAD MORE事件中下載圖像。 這裏是我的代碼:`接收內存泄漏
-(void)btnLoadMorePressed
{
[appdelegate showLoader:MBProgressHUDModeIndeterminate];
RequestResponseManager *requestManager=[RequestResponseManager sharedInstance];
[requestManager setRequestPropery:self ExtraInfo:nil];
Album *album=[appdelegate.CurrentUser.albumListarray objectAtIndex:indexNum-1];
NSArray *obj_keys = [NSArray arrayWithObjects:@"UserId",@"AlbumId",@"SessionId",@"PageNo",@"ModMethod", nil];
NSArray *objects = [NSArray arrayWithObjects:appdelegate.CurrentUser.userId,album.AlbumId,appdelegate.sessionId,[NSString stringWithFormat:@"%d",currentPage],@"getPhotoListByAlbumId",nil];
NSDictionary *jsonDictionary = [NSDictionary dictionaryWithObjects:objects forKeys:obj_keys];
NSString *jsonString = [jsonDictionary JSONRepresentation];
NSString *requestString=[NSString stringWithFormat:@"data=%@",jsonString];
currentRequest=JGetAlbumPhotoList;
[requestManager sendPostHttpRequest:GET_USER_ALBUM_PHOTO_URL RequestType:JGetAlbumPhotoList PostContent:requestString];
}
,但是當我試圖獲取更多的圖像,它給了我記憶警告,然後突然crashing.please幫助me.thanking你......
您需要詳細說明發生了什麼。什麼錯誤消息,你有什麼堆棧跟蹤和日誌記錄? –
這是我的圖像下載代碼: - (void)StartImageDownload { ImageDownload = 0; (int i = 0; i <[appdelegate.CurrentUser.albumImageArray count]; i ++) {0121} if(!aPhoto.Image) [self startIconDownload:aPhoto.ImageName forIndexPath:[NSNumber numberWithInt:i]]; else { ImageDownload ++; } } } – HML
- (無效)startIconDownload:(的NSString *)用戶forIndexPath:(的NSNumber *)指數 { 如果([用戶長度] == 0) 回報; IconDownloader * iconDownloader = [imageDownloadsInProgress objectForKey:index]; (iconDownloader ==零) iconDownloader = [[IconDownloader alloc] init]; iconDownloader.imageKey = index; iconDownloader.imgURL = user; iconDownloader.appRecord = self; [imageDownloadsInProgress setObject:iconDownloader forKey:index]; [iconDownloader startDownload]; [iconDownloader發佈]; } } – HML