commuclientappdelegate.m

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

M
57
字号
////  CommuClientAppDelegate.m//  CommuClient////  Created by Owen.Qin on 9/24/08.//  Copyright __MyCompanyName__ 2008. All rights reserved.//#import "CommuClientAppDelegate.h"@implementation CommuClientAppDelegate@synthesize window;@synthesize _communicate, _arrayMsgMap;- (void)applicationDidFinishLaunching:(UIApplication *)application {		self._arrayMsgMap = [NSMutableArray array];	self._communicate = [[iCommunicate alloc] init];	// "register" message	iMapMsgIdAndCallBack* mapRegister = [[iMapMsgIdAndCallBack alloc] init];	mapRegister->_msgId = @"register";	mapRegister->_callback = (iCommCallBack)&recvRegisterReply;	[self._arrayMsgMap addObject:(id)mapRegister];	[mapRegister release];	// "TextChat" message	iMapMsgIdAndCallBack* mapTextChat = [[iMapMsgIdAndCallBack alloc] init];	mapTextChat->_msgId = @"TextChat";	mapTextChat->_callback = (iCommCallBack)&recvTextChat;	[self._arrayMsgMap addObject:(id)mapTextChat];	[mapTextChat release];	NSString* nstrIpAddr = @"172.19.1.190";	NSString* nstrUserName = @"Erin";	[self._communicate startClientWithName:nstrUserName Addr:nstrIpAddr Port:5566 CallBack:(void*)self._arrayMsgMap];	// Override point for customization after app launch	    [window makeKeyAndVisible];}- (void)dealloc {	[self._arrayMsgMap release];	[self._communicate release];	[window release];	[super dealloc];}static void recvRegisterReply(iMsg* msg){	CommuClientAppDelegate* delegate = [[UIApplication sharedApplication] delegate];	[delegate.window recvRegisterReply:msg];}static void recvTextChat(iMsg* msg){	CommuClientAppDelegate* delegate = [[UIApplication sharedApplication] delegate];	[delegate.window recvRegisterReply:msg];}@end

⌨️ 快捷键说明

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