- 浏览: 1444537 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
例子可跑
http://www.oschina.net/translate/intro-multipeer-connectivity-framework-ios-programming?lang=chs&page=1#
git
https://github.com/kakegawa-atsushi/MultipeerConnectivitySample
http://www.oschina.net/translate/intro-multipeer-connectivity-framework-ios-programming?lang=chs&page=1#
git
https://github.com/kakegawa-atsushi/MultipeerConnectivitySample
// // FirstViewController.m // MCDemo // // #import "FirstViewController.h" #import "AppDelegate.h" @interface FirstViewController () @property (nonatomic, strong) AppDelegate *appDelegate; -(void)sendMyMessage; -(void)didReceiveDataWithNotification:(NSNotification *)notification; @end @implementation FirstViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. _appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; _txtMessage.delegate = self; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didReceiveDataWithNotification:) name:@"MCDidReceiveDataNotification" object:nil]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma mark - UITextField Delegate method implementation -(BOOL)textFieldShouldReturn:(UITextField *)textField{ [self sendMyMessage]; return YES; } #pragma mark - IBAction method implementation - (IBAction)sendMessage:(id)sender { [self sendMyMessage]; } - (IBAction)cancelMessage:(id)sender { [_txtMessage resignFirstResponder]; } #pragma mark - Private method implementation -(void)sendMyMessage{ NSData *dataToSend = [_txtMessage.text dataUsingEncoding:NSUTF8StringEncoding]; NSArray *allPeers = _appDelegate.mcManager.session.connectedPeers; NSError *error; [_appDelegate.mcManager.session sendData:dataToSend toPeers:allPeers withMode:MCSessionSendDataReliable error:&error]; if (error) { NSLog(@"%@", [error localizedDescription]); } [_tvChat setText:[_tvChat.text stringByAppendingString:[NSString stringWithFormat:@"I wrote:\n%@\n\n", _txtMessage.text]]]; [_txtMessage setText:@""]; [_txtMessage resignFirstResponder]; } -(void)didReceiveDataWithNotification:(NSNotification *)notification{ MCPeerID *peerID = [[notification userInfo] objectForKey:@"peerID"]; NSString *peerDisplayName = peerID.displayName; NSData *receivedData = [[notification userInfo] objectForKey:@"data"]; NSString *receivedText = [[NSString alloc] initWithData:receivedData encoding:NSUTF8StringEncoding]; [_tvChat performSelectorOnMainThread:@selector(setText:) withObject:[_tvChat.text stringByAppendingString:[NSString stringWithFormat:@"%@ wrote:\n%@\n\n", peerDisplayName, receivedText]] waitUntilDone:NO]; } @end
- MCDemo.zip (218.3 KB)
- 下载次数: 0
发表评论
-
facebook的socketrocket总结
2018-03-19 13:36 1378最近看了开源的网易的demo https://netease. ... -
使用websocket,双ibeacons判断方向
2014-12-16 04:08 1989只调用ibeacon的接口 // // ViewCon ... -
ios的页面跳转
2014-12-03 17:30 1336一种通过导航,一种直 ... -
打包ipa
2014-11-14 23:10 7361.新建一个文件夹命名为:Payload 2.将buid生成的 ... -
ios指南针
2014-10-25 17:06 1049参考http://blog.sina.com.cn/s/blo ... -
linux下编译objectc
2014-10-23 01:24 861编译静态库给ios使用 http://www.tuicool. ... -
ios加速计和陀螺仪
2014-10-22 23:03 1209ios设备中有的加速计可以测量出加速度和重力。陀螺仪可用于确定 ... -
ios仿微信的demo
2014-10-20 00:31 2299610月19日闲的蛋疼,做了个 仿微信的聊天工具 git地址:h ... -
自制微信的ui
2014-10-19 22:28 877参考http://ios.9tech.cn/news/2013 ... -
ios8的tableView使用
2014-10-18 20:34 835ios8是main.storyboard 不是 ... -
ios的opencv的helloworld
2014-10-12 23:38 941xcode6, 学习的源码在 http://opencv.or ... -
ios opencv的一些资源
2014-10-11 00:08 775opencv for ios build http://ww ... -
ios客户端websocket的helloworld
2014-10-09 02:11 23147ios8,xcode6 https://github.com/ ... -
ios8的定位,蓝牙与ios7的区别
2014-10-06 23:27 3619以前程序的地理定位功能在iOS8 版上不能工作了(也可能其 ... -
ios的helloworld 2
2014-09-09 21:51 1267参考视频: www.imooc.com/learn/149 S ... -
ios的helloworld
2014-09-08 19:51 670参考http://www.macx.cn/thread-210 ... -
生成ipa 这个是自己总结的,ios5.1.1越狱系统,xcode4.3.3可用
2012-07-29 20:44 1948最有用的一段 export CODESIGN_ALLOCA ... -
ios上使用gcc
2012-07-18 23:21 3209安装network-cmds apptitude iphone ... -
m3u8在windows上预览
2012-06-12 14:25 6967<html> <head> ... -
cocoahttpserver
2012-03-21 22:19 1919https://github.com/robin/cocoa- ...
相关推荐
THMultpeer 是 Apple iOS Multipeer Connectivity 框架之上的包装器。 它提供了一种更简单的方法来创建和管理会话。 它将节省您处理断开连接的时间,并且已经具有通过将 displayName 设置为设备 ...
iOS 7的近场通信框架 Multipeer Connectivity的sample,可以大致了解怎么使用这个框架。
Multipeer Connectivity Framework 是iOS 7 推出的众多新框架的一种,它拓宽了操作系统中应用的范围。其目的是使开发者可以创建通过Wi-Fi或蓝牙在近距离建立连接的应用。是在近距离设备间建立互动,交换数据和其他...
MCBroadcast 是一种使用 Multipeer Connectivity 框架与附近设备进行通信的简单方法。 用Swift编写。 使用 iOS SDK 8.3 开发 这个怎么运作 浏览和广告服务 查找附近的同伴以邀请参加会议或自动获得邀请 用法 初始化...
零配置的Multipeer Connectivity应用程序的开源Swift框架用法//使用此服务类型自动检测并附加到其他对等方PeerKit.transceive(“ PeerKit一个用于构建事件驱动的开源Swift框架,零配置Multipeer Connectivity应用...
iOS_MultipeerServiceExample 这是 Brett Ohland 的视图控制器使用 Multipeer Connectivity 的直接副本,来自 。 它允许自动直接连接两个设备,而无需担心连接对话框
多点连接苹果的Multipeer连接框架的C ++包装器它抽象了Multipeer Connectivity的一些潜在重要功能,但确实提供了一种简单的方法来连接到对等方以及发送和接收数据。界面NetworkingWrapper是可与之交互以使用...
我在 Codemotion 2014 中谈论 Multipeer Connectivity 的材料,马德里: 。 幻灯片 。 。 演示 聊天 使用-sendData:toPeers:withMode:error: 。 结果( )。 分享照片 使用- sendResourceAtURL:withName:toPeer:...
iOS multipeerconnectivity demo可以传输文件,Wi-Fi p2p
More iPhone Development with Swift covers topics like Swift, Core Data, peer-to-peer networking using Multipeer Connectivity, working with data from the web, MapKit, in-application e-mail, Camera Live...
Day 23 :: Multipeer Connectivity Day 24 :: The End Each day's post will have an associated sample project so that you can see the concepts in action. These will all be available in the github repo at ...
该项目是有关Multipeer Connectivity框架的一个小练习。 该框架允许设备通过本地WI-FI,对等WI-FI和蓝牙发现附近的设备。 用法 首先,在输入屏幕上按连接,然后在Mac上打开服务器。 它将列出当前共享相同服务类型的...
AirDrop swift 使用MultipeerConnectivity框架实现附近iOS设备间的近距离数据传输 优点:传输数据快,适合大量数据的传输 demo界面如下:
Morse Chat 大量使用 Apple 的 Multipeer Connectivity 框架将摩尔斯电码发送到任何动态发现的本地对等方。 该应用程序通过 WiFi 或蓝牙以零配置建立本地连接,并通过状态栏提供简单的连接状态。 此应用程序使用...
android-connectivity.7z
connectivity
More iPhone Development with Swift covers topics like Swift, Core Data, peer-to-peer networking using Multipeer Connectivity, working with data from the web, MapKit, in-application e-mail, Camera Live...
More iPhone Development with Objective-C covers a variety of other topics, including Multipeer Connectivity's relatively simple Bluetooth/WiFi peer-to-peer model, MapKit, and media library access and ...
More iPhone Development with Objective-C covers a variety of other topics, including Multipeer Connectivity’s relatively simple Bluetooth/WiFi peer-to-peer model, MapKit, and media library access and...