Asyncsocket崩溃了

时间:2013-10-13 21:02:55

标签: ios xcode asyncsocket

任何人都可以告诉我代码连接的原因

- (IBAction)connectBtn:(id)sender {

  socket = [[AsyncSocket alloc] initWithDelegate: self];
  [socket connectToHost: @"127.0.0.1" onPort: 4321 error: nil];

}

,以下代码在connecttohost

上崩溃
- (void)viewDidLoad
{
 socket = [[AsyncSocket alloc] initWithDelegate: self];
  [super viewDidLoad];

}
- (IBAction)connectBtn:(id)sender {

[socket connectToHost: @"127.0.0.1" onPort: 4321 error: nil];

 }

套接字在视图controller.h文件中定义

 @interface ViewController : UIViewController{
 AsyncSocket *socket;

 }

0 个答案:

没有答案