0
我每次滾動的實現代碼如下一個新的細胞出現時,它得到的卡住像毫秒,即發生的每出現一個新的小區時,..我試過這麼多的選擇..的tableview不順利滾動的iOS的Xcode
這是我查詢我的數組
- (void) retrieveStrings {
PFQuery *retrieveAllPictures = [PFQuery queryWithClassName:@"String_Pictures"];
[retrieveAllPictures includeKey:@"string_owner"];
[retrieveAllPictures whereKey:@"string_boss" equalTo:[PFObject objectWithoutDataWithClassName:@"String" objectId:original_string_objectID]];
retrieveAllPictures.limit = [loadingNumber intValue];
[retrieveAllPictures orderByDescending:@"createdAt"];
[retrieveAllPictures findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
originalString = [[NSArray alloc]initWithArray:objects];
[self.StringTable reloadData];
}
}];
}
這是我行單元格AT索引路徑
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"originalStringCell";
OriginalStringTableViewCell *originalCell = [StringTable dequeueReusableCellWithIdentifier:CellIdentifier];
tempObject = [originalString objectAtIndex:indexPath.row];
userObject = [tempObject objectForKey:@"string_owner"];
originalTempString = [tempObject objectForKey:@"string_image"];
[originalTempString getDataInBackgroundWithBlock:^(NSData *data, NSError *error) {
if (!error) {
originalCell.original_string_image.image = [UIImage imageWithData:data];
CGFloat ImageWidth = ceil(originalCell.original_string_image.image.size.width);
CGFloat ImageHeight = ceil(originalCell.original_string_image.image.size.height);
CGFloat NewWidth = ceil ((ImageWidth/ImageWidth) * StringTable.frame.size.width);
CGFloat NewHeightImageRow = ceil ((ImageHeight/ImageWidth) * StringTable.frame.size.width);
originalCell.original_string_image.frame = CGRectMake(0, 53, NewWidth, NewHeightImageRow);
NSLog(@"%f",NewWidth);
[originalCell.stringIndicator stopAnimating];
originalCell.stringIndicator.hidden = YES;
[SVProgressHUD dismiss];
}
}];
return originalCell;
}
沒關係的人,我一直在使用SDWebImage – user3147328
即使你搞清楚自己,發佈解決方案作爲一個答案,而不是編輯發現它自己。 –
蒂姆·威爾金森,確定THX我已經改變了它 – user3147328