我有一个在内部调用 API 的方法。该方法没有任何完成处理程序。
-(void) methodToBeTested{
[self callAPIWithCompletionHandler:^(NSArray *data,NSError *error)
{
//Here I get the response and sets the models.
}];
}
Run Code Online (Sandbox Code Playgroud)
现在我需要测试 API 调用后设置的模型的方法“methodToBeTested”基础。
有什么建议?
我正在使用 NSNetServiceBrowser 解析 udp 服务。它工作正常,但如果我断开我的服务,它也会发现它。我收到了一个链接,上面写着它在一段时间内仍然可见,因为 DNS 记录达到了它的生存时间间隔并消失了。链接 - https://developer.apple.com/library/prerelease/content/documentation/Cocoa/Conceptual/NetServices/Articles/faq.html (第 4 点)
如何刷新缓存以便无法访问服务?