-
Notifications
You must be signed in to change notification settings - Fork 503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IOS接受到消息的方法里怎么调用不了UIViewController里的其他方法? #66
Comments
注释里已经说非常清楚了, 因为这是单独的线程. 你需要搜索一下iOS多线程相关的资料. 简单点说, 就是要
|
好的,感谢 |
能给个简单的事例吗,照你的方法好像不行
} |
你好, 之前回复的方案不完整, 我已经更新了 wiki 中的示例, 你参考示例代码即可: https://github.com/ideawu/icomet/wiki/iComet-for-iOS-App |
// this function is called in a separated thread, it gets called when receive msg from icomet server
//回调接口
size_t icomet_callback(char _ptr, size_t size, size_t nmemb, void *userdata)
{
const size_t sizeInBytes = size_nmemb;
NSData data = [[NSData alloc] initWithBytes:ptr length:sizeInBytes];
NSString s = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
}
The text was updated successfully, but these errors were encountered: