草庐IT

query-cache

全部标签

ios - 在 iOS 上,由于 dataWithContentsOfURL :options:error: has an option to not cache data, 这是否意味着 dataWithContentsOfURL 缓存数据?

不缓存数据的选项是NSDataReadingUncached。但是如果我使用dataWithContentsOfURL从UITableViewCell中的URL更新图像(每个单元格一个图像),然后我查看Mac上的事件监视器模拟器(运行为iOS5.1模拟器),然后当我连续上下滚动表格时,网络流量跃升至12kb/s的接收速率。当我停止上下滚动时,网络事件下降到大约2kb/s的接收速率或更低。这些图像非常小,每个大约20kb,当我上下滚动时,我只会让1或2个图像消失/出现,所以缓存(如果有的话)根本不需要很大。所以它看起来像dataWithContentsOfURL不缓存数据,即使我使用da

ios - 是 NSData + (id)dataWithContentsOfURL :(NSURL *)aURL options:(NSDataReadingOptions)mask error:(NSError **)errorPtr: cached automatically?

当我阅读关于的部分时NSDataReadingOptionsOptionsformethodsusedtoreadNSDataobjects.enum{NSDataReadingMappedIfSafe=1UL上面写着NSDataReadingUncached指示文件不应存储在文件系统缓存中的提示。对于只读一次就丢弃的数据,这个选项可以提高性能。适用于OSXv10.6及更高版本。在NSData.h中声明。所以我假设默认情况下这些URL请求被缓存并且如果我想使用共享全局缓存则不需要实现NSURLRequest来缓存数据?这种理解是否正确? 最佳答案

iOS Facebook SDK "An active access token must be used to query information about the current user."

我有一个token,但一直收到此错误:“必须使用事件访问token来查询有关当前用户的信息。”任何帮助表示赞赏:)NSLog(@"TOKEN:%@",[[FBSessionactiveSession]accessToken]);NSString*picture=[NSStringstringWithFormat:@"http://www.prowebdev.org/WooF/API/OpenGraph.php"];NSString*image=[NSStringstringWithFormat:@"http://www.prowebdev.org/WooF/API/upload/356

安卓机房 : Each bind variable in the query must have a matching method

我正在使用带有Kotlin的android持久性库Room。道是这样的@DaointerfaceCountryDao{@Query("SELECT*FROMcountries")funloadAllCountried():LiveData>@Insert(onConflict=OnConflictStrategy.REPLACE)funinsertAll(products:List)@Query("SELECT*FROMcountriesWHEREid=:countryId")funloadCountry(countryId:Int):LiveData@Query("SELECT*FR

安卓机房 : Each bind variable in the query must have a matching method

我正在使用带有Kotlin的android持久性库Room。道是这样的@DaointerfaceCountryDao{@Query("SELECT*FROMcountries")funloadAllCountried():LiveData>@Insert(onConflict=OnConflictStrategy.REPLACE)funinsertAll(products:List)@Query("SELECT*FROMcountriesWHEREid=:countryId")funloadCountry(countryId:Int):LiveData@Query("SELECT*FR

objective-c - 在 UITableViewCell : How to cache to prevent reload? 中嵌入 YouTube 视频

我通过以下代码将youtube视频缩略图嵌入到我的UITableView单元格中。但是,每当我滚动表格时,视频缩略图都会在单元格离开屏幕并返回时重新加载。缓存缩略图以便它们只在第一次加载时最有效的方法是什么?-(UITableViewCell*)tableView:(UITableView*)tableViewcellForRowAtIndexPath:(NSIndexPath*)indexPath{staticNSString*PlaceholderCellIdentifier=@"PlaceholderCell";SearchResult*searchResult=[self.se

ios - -canOpenURL : failed for URL: "fbauth2:/" - error: "This app is not allowed to query for scheme fbauth2" (OSStatus error -10814. )

当我尝试登录时出现此错误消息:_-canOpenURL:failedforURL:"fbauth2:/"-error:"Theoperationcouldn’tbecompleted.(OSStatuserror-10814.)"我有macOSHighSierra10.13.6。我的Xcode版本是9.4.1。SDKiOS10.2,模拟器我试过方法但没有帮助:https://developers.facebook.com/docs/ios/ios9我也确实尝试过LSApplicationQueriesSchemes但也没有成功。 最佳答案

ios - OAuthException/代码 = 2500/消息 = "An active access token must be used to query information about the current user."

我正在尝试获取登录用户的数据(如姓名、性别、生日、个人资料图片等)。我尝试了以下两个代码,如下所示://first:Createrequestforuser'sFacebookdataFBRequest*request=[FBRequestrequestForMe];//SendrequesttoFacebook[requeststartWithCompletionHandler:^(FBRequestConnection*connection,idresult,NSError*error){NSLog(@"%@",error);if(!error){//resultisadictio

ios - 完成以下错误 "This query has an outstanding network connection. You have to wait until it'。”

我不明白为什么我得到'此查询具有出色的网络连接。您必须等到它完成。因为我只运行一个查询任何人都可以在这里帮忙,因为我是新手解析-(id)initWithCoder:(NSCoder*)aCoder{self=[superinitWithCoder:aCoder];if(self){//Customizethetable//TheclassNametoqueryonself.parseClassName=@"Exibitor";//ThekeyofthePFObjecttodisplayinthelabelofthedefaultcellstyleself.textKey=@"name"

ios - "error: This object is not available in the offline cache"仅在 Parse 后端出现几次

我目前将解析后端添加到我的ios项目并将其定义为与其本地数据存储一起使用。这一切似乎都工作正常,除了有时我收到“这个对象在离线缓存中不可用”,据我所知,在使用本地数据存储时根本没有缓存(在我的AppDelegate中启用它,就像这样:[解析enableLocalDatastore];)。问题是如果我重新打开应用程序,最终将成功检索到该对象。以前有人遇到过这个问题吗?编辑:我打电话的顺序是PFQuery*query=[PFQueryqueryWithClassName:className];[queryfromLocalDatastore];[querywhereKey:someKeye