久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

NSURLRequest 在 UIScrollView 滾動(dòng)時(shí)不會(huì)觸發(fā)

NSURLRequest won#39;t fire while UIScrollView is scrolling(NSURLRequest 在 UIScrollView 滾動(dòng)時(shí)不會(huì)觸發(fā))
本文介紹了NSURLRequest 在 UIScrollView 滾動(dòng)時(shí)不會(huì)觸發(fā)的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

問題描述

我有一個(gè)問題,我試圖在用戶在 UIScrollView 周圍移動(dòng)時(shí)在后臺(tái)加載聲音文件...問題是我正在使用 NSURLRequest 所以我可以在后臺(tái)加載,但即使這樣它也拒絕實(shí)際加載直到 UIScrollView 停止?jié)L動(dòng).:(

I have a problem in that I am trying to background load a sound file while the user moves around a UIScrollView... The problem is that I am using NSURLRequest so I can load in the background, but even then it refuses to actually load until the UIScrollView has stopped scrolling. :(

對(duì)此我有什么辦法嗎?

謝謝!

推薦答案

NSURLRequest 只管理請(qǐng)求,不管理實(shí)際連接.

The NSURLRequest only manages the request, not the actual connection.

滾動(dòng)等觸摸事件會(huì)將運(yùn)行循環(huán)置于NSEventTrackingRunLoopMode.默認(rèn)情況下,NSURLConnection 被調(diào)度為NSDefaultRunLoopMode 中執(zhí)行.所以在 NSEventTrackingRunLoopMode 中,NSDefaultRunLoopMode 被阻塞了.

Touch events such as scrolling will place the run loop into NSEventTrackingRunLoopMode. By default, an NSURLConnection is scheduled to only execute in NSDefaultRunLoopMode. So while in NSEventTrackingRunLoopMode, NSDefaultRunLoopMode is blocked.

好消息是您可以為 NSURLConnection 安排其他模式,例如 NSRunLoopCommonModes.

Good news is that you can schedule additional modes for an NSURLConnection, such as NSRunLoopCommonModes.

connection = [[NSURLConnection alloc] initWithRequest:request delegate:self startImmediately:NO];
[connection scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSRunLoopCommonModes];
[connection start];

這篇關(guān)于NSURLRequest 在 UIScrollView 滾動(dòng)時(shí)不會(huì)觸發(fā)的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請(qǐng)聯(lián)系我們刪除處理,感謝您的支持!

相關(guān)文檔推薦

UIButtons at the bottom of UIScrollView not working(UIScrollView 底部的 UIButtons 不起作用)
scrollViewWillEndDragging:withVelocity:targetContentOffset: not working on the edges of a UISCrollView(scrollViewWillEndDragging:withVelocity:targetContentOffset: 不在 UISCrollView 的邊緣工作) - IT屋-程序員軟件開發(fā)技術(shù)分享社
ImageView Scaling when scrolling down(向下滾動(dòng)時(shí) ImageView 縮放)
Bounds automatically changes on UIScrollView with content insets(UIScrollView 上的邊界自動(dòng)更改,帶有內(nèi)容插圖)
iOS5 UITapRecognizer for UIScrollView interfering with buttons. How to fix?(用于 UIScrollView 的 iOS5 UITapRecognizer 干擾按鈕.怎么修?)
Handling scroll views with (custom, interactive) view controller presentation and dismissal(使用(自定義、交互式)視圖控制器呈現(xiàn)和解除處理滾動(dòng)視圖)
主站蜘蛛池模板: 精品一区视频 | 亚洲国产精品一区二区久久 | 天天插天天狠天天透 | 毛片com | 91精品国产乱码久久久 | 色狠狠桃花综合 | 国产精品视频一 | 免费一区二区三区 | 国产欧美日韩精品一区 | 狠狠久| 国产精品一区在线 | 中文字幕 欧美 日韩 | 免费观看一级特黄欧美大片 | 又爽又黄axxx片免费观看 | 中文字幕视频免费 | 日本三级精品 | 欧洲亚洲视频 | 国产又色又爽又黄又免费 | 国产精品不卡 | 亚洲激情综合网 | 日韩在线中文 | 亚洲精品国产a久久久久久 中文字幕一区二区三区四区五区 | 在线观看www视频 | 久久lu | 国产美女一区 | 黄色精品| 日韩色视频 | 日日爱夜夜操 | 日韩欧美日韩在线 | 一区二区三区视频在线免费观看 | 青青久在线视频 | 国产精品永久久久久 | 欧美激情国产日韩精品一区18 | 欧美精品影院 | 国产一级久久久久 | 欧美激情久久久 | 精久久| 国产精品一区在线观看 | 九色视频网站 | 综合久久久久久久 | 精品一区二区久久久久久久网精 |