我正在使用objective-c中的套接字,所以我编写了一个函数,用于在我的条件成真时获取服务器的响应我想推送到下一个视图控制器,但它没有推送或呈现请帮助这里给出一些代码
这是我的功能
void receiveData(CFSocketRef s,
CFSocketCallBackType type,
CFDataRef address,
const void *data,
void *info)
{
LoginViewController *lvc = [[LoginViewController alloc] init];
char *buffer = (char *)CFDataGetBytePtr((CFDataRef)data);
if (strstr(buffer, "LCNF|ACPT") == NULL)
{
NSLog(@"%@",data);
[lvc alert];
}
else
[lvc goToWatchList];
}
我的“goToWatchlist”方法是:
-(void)goToWatchList
{
WatchListViewController *wlController = [[WatchListViewController alloc] initWithNibName:@"WatchListViewController" bundle:nil];
[self presentModalViewController:wlController animated:YES];
[wlController release];
}
提前感谢