小编Dec*_*and的帖子

Xcode - [UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:]:第(7)行超出第(0)节的边界(0).

我刚刚将这个AGPhotoBrowser类实现到我的Xcode项目中,我得到的错误是:

Terminating app due to uncaught exception 'NSRangeException', reason: '-[UITableView _contentOffsetForScrollingToRowAtIndexPath:atScrollPosition:]: row (7) beyond bounds (0) for section (0).'
Run Code Online (Sandbox Code Playgroud)

崩溃发生的代码在这里:

#pragma mark - UIScrollViewDelegate
- (void)scrollViewDidScroll:(UIScrollView *)scrollView
{
    if (!self.currentWindow.hidden && !_changingOrientation) {
        [self.overlayView resetOverlayView];

        CGPoint targetContentOffset = scrollView.contentOffset;

        UITableView *tv = (UITableView*)scrollView;
        NSIndexPath *indexPathOfTopRowAfterScrolling = [tv indexPathForRowAtPoint:targetContentOffset];

        [self setupPhotoForIndex:indexPathOfTopRowAfterScrolling.row];
    }
}
Run Code Online (Sandbox Code Playgroud)

一旦我退出实现的ViewController地方,崩溃似乎就会发生?

xcode objective-c uiscrollview ios uicollectionview

3
推荐指数
1
解决办法
1万
查看次数

JavaScript - 5 秒后单击所有带有类名称的按钮 (Twitter)

我多年来一直试图让我的脚本发挥作用,但它就是不成功!我试图在 5 秒后点击我的 Twitter/关注页面上的所有“取消关注”按钮。这是我的代码,没有 setInterval 函数:

var buttonArray = document.getElementsByClassName('w-button-common w-button-unfollow'); for(var a=0;a<buttonArray.length;a++){ buttonArray[0].click(); } 
Run Code Online (Sandbox Code Playgroud)

以下是取消关注按钮的 Twitter HTML DOM 代码:

    <span class="w-button-common w-button-unfollow"><input alt="Follow" src="https://ma.twimg.com/twitter-mobile/97bb0ca1daa74ae65fd470b1961897275eb91579/images/sprites/followchecked.gif" type="image"></span>
  <input type="hidden" name="scribe_item" value="description=list&amp;id=1875185790&amp;item_type=3">
</form>
</td>
Run Code Online (Sandbox Code Playgroud)

如果有人可以修改我的代码,我将不胜感激!提前非常感谢!

javascript twitter jquery click button

1
推荐指数
1
解决办法
5107
查看次数