OGeek|极客世界-中国程序员成长平台

标题: ios - 多人连接广告商进度跟踪 [打印本页]

作者: 菜鸟教程小白    时间: 2022-12-12 14:59
标题: ios - 多人连接广告商进度跟踪

我以这种方式在 ios7 中使用多点连接发送文件:

[browser invitePeer:key
                              toSession:session
                            withContext:myData
                                timeout:interval];

而另一个用户以这种方式接收它:

- (void) advertiserMCNearbyServiceAdvertiser *)advertiser
didReceiveInvitationFromPeerMCPeerID *)peerID
    withContextNSData *)context
 invitationHandlervoid(^)(BOOL accept,
                          MCSession *session))invitationHandler{

问题是某些文件很大,例如30mb,需要一段时间。我想进行某种进度跟踪。这可能吗?



Best Answer-推荐答案


NSProgress 通过委托(delegate)方法传递

– session:didStartReceivingResourceWithName:fromPeer:withProgress:

可用于跟踪进度,直到

– session:didFinishReceivingResourceWithName:fromPeer:atURL:withError:

被称为

关于ios - 多人连接广告商进度跟踪,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19070342/






欢迎光临 OGeek|极客世界-中国程序员成长平台 (http://ogeek.cn/) Powered by Discuz! X3.4