myuiwindow.m

来自「针对于Communication通信中间件的Server端程序。」· M 代码 · 共 39 行

M
39
字号
#import "MyUIWindow.h"@implementation MyUIWindow- (IBAction)sendMsg:(id)sender {    NSString* nstrMsgId = @"register";	NSString* nstrMsgDest = @"Owen";	NSString* nstrMsgBody = oTextSend.text;		CommuServerAppDelegate* delegate = [[UIApplication sharedApplication] delegate];	iMsg* msg = [delegate._communicate bundleMsgWithMsgId:nstrMsgId Dest:nstrMsgDest Body:nstrMsgBody];	[delegate._communicate sendMsgToClient:msg];}- (void)recvRegisterFromClient:(iMsg*)msg{	[oTextRecv setText:msg->_msgBody];}- (void)recvTextChat:(iMsg*)msg{	// transmit message	CommuServerAppDelegate* delegate = [[UIApplication sharedApplication] delegate];	[delegate->_communicate sendMsgToClient:msg];}- (void)becomeKeyWindow{	oTextRecv.text = @"";	oTextSend.text = @"";}- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{    // Dismiss the keyboard when the view outside the text field is touched.    [oTextSend resignFirstResponder];	[oTextRecv resignFirstResponder];    // Revert the text field to the previous value.    [super touchesBegan:touches withEvent:event];}@end

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?