?? 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 + -