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