📄 commuclientappdelegate.m
字号:
//// 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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -