Ios 该方法在调用时未运行某些行

Ios 该方法在调用时未运行某些行,ios,xcode,tcpserver,Ios,Xcode,Tcpserver,//setup.m void receiveData(CFSocketRef s, CFSocketCallBackType type, CFDataRef address, const void *data, void *info) { gameboard *board = [[gameboard alloc] initWithNibName:nil bundle:nil]; NSString *buffer = [[NSString alloc] init

//setup.m

void receiveData(CFSocketRef s, CFSocketCallBackType type, 
             CFDataRef address, const void *data, void *info)
{ 

gameboard *board = [[gameboard alloc] initWithNibName:nil bundle:nil];


NSString *buffer = [[NSString alloc] initWithData:(NSData *)data
encoding:NSUTF8StringEncoding];

NSLog(@"Buffer is %@", buffer);

[board activateButton:buffer]; 
//gameboard.m

-(void) activateButton:(NSString *)trigger;{

[self viewDidLoad];

NSLog(@"Received from setup: %@", trigger);
upDatePos = [trigger intValue];
NSLog(@"upDatePos is %d",upDatePos);
btnMyButton.enabled = YES;
[self drawPosition:upDatePos];
NSLog(@"End of activateButton");
}


-(void) p2drawPosition:(int)number;{

NSLog(@"Number in p2draw Position is %d",number);
xPos = [[P2XArraypos objectAtIndex:number]intValue];
yPos = [[P2YArraypos objectAtIndex:number]intValue];
NSLog(@"xPos is %f",xPos);
NSLog(@"yPos is %f",yPos);

image2.center= CGPointMake(xPos,yPos);

}
当我运行它时。我的视图将进入setup->gameboard。tcp服务器将创建并运行Loop以接收传入数据。y视图将在gameboard停止,并等待安装程序的databuffer调用activateButton。调用activateButton后,还应运行以下行

btnMyButton.enabled = YES;
image2.center= CGPointMake(xPos,yPos);
但我的按钮仍然禁用,我的image2仍然没有更新位置 我还使用UIAlertView进行测试,它在调用时仍然会弹出

有人能告诉我发生了什么事吗?如何修复它


非常感谢。

offtopic:类名应该总是以大写字母开头。很抱歉,以前没人告诉我。