简体   繁体   English

在WebService连接方法之前调用viewDidAppear

[英]viewDidAppear being called before WebService connection methods

ViewDidAppear method I put breakpoint in the last step of the operation, but the breakpoint viewDidAppear method of putting at first, trying to run it directly. ViewDidAppear方法我将断点放在操作的最后一步,但是将断点的viewDidAppear方法放在首先要尝试直接运行的地方。 Are emerging in connection using WebService. 使用WebService的连接正在兴起。 Be the first breakpoint while running webservice connections, calling the latest viewDidAppear. 在运行Web服务连接时成为第一个断点,并调用最新的viewDidAppear。 However, prior to providing breakpoint viewDidAppear when calling WebService connection, and this causes the value NULL to return. 但是,在调用WebService连接时提供断点viewDidAppear之前,这将导致返回值NULL。 In short, I would like to be called viewDidAppear method, after obtaining all the webservice connections. 简而言之,在获得所有Web服务连接之后,我想称为viewDidAppear方法。 Breakpoint when it's like this, but when I want to work in the same way. 断点是这样的,但是当我想以相同的方式工作时。

- (void)viewDidAppear:(BOOL)animated
{
[self LabelYukle];
[super viewDidAppear:animated];
}

-(void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
if(theConnection)
    [webData setLength:0];
}

viewDidAppear is called by iOS system on its own just before view is going to be appeared. 在系统将要显示视图之前,iOS系统会自行调用viewDidAppear If you want to perform some functions after didReceiveResponse method, there is a method in NSURLConnectionDelegate that can help you. 如果要在didReceiveResponse方法之后执行某些功能,则NSURLConnectionDelegate中有一个可以帮助您的方法。

- (void)connectionDidFinishLoading:(NSURLConnection *)connection

This method is used when a connection has finished loading successfully and you can write the functions you want to perform after didRecieveRespose here in this method. 连接成功加载完成后,可以使用此方法,并且您可以在此方法中执行didRecieveRespose之后编写要执行的功能。

You can read more about NSURLConnectionDelegateProtocol methods here. 您可以在此处阅读有关NSURLConnectionDelegateProtocol方法的更多信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iPhone-在viewDidAppear之前调用numberOfRowsInSection - iphone - numberOfRowsInSection being called before viewDidAppear 没有调用ViewDidAppear / ViewWillAppear - ViewDidAppear/ViewWillAppear not being called 在applicationDidBecomeActive之前调用viewDidAppear - viewDidAppear called before applicationDidBecomeActive viewWillAppear,viewDidAppear没有被调用,没有被触发 - viewWillAppear, viewDidAppear not being called, not firing 在UIViewController中未调用viewDidAppear和viewWillDisappear - viewDidAppear and viewWillDisappear not being called in UIViewController viewDidAppear 在它实际出现之前调用? - viewDidAppear called BEFORE it actually appears? 为什么不调用viewWillDisappear或viewDidAppear? - Why isn't viewWillDisappear or viewDidAppear being called? 使用 UINavigationController 时,不会调用控制器的 viewWillAppear 或 viewDidAppear 方法 - When using a UINavigationController the viewWillAppear or viewDidAppear methods of my controller are not called 如何在类方法完成之前处理再次被调用? - How to handle class methods being called again before they are finished? UIViewController的viewDidAppear / viewDidDisappear:到底什么时候应该调用这些方法? - UIViewController's viewDidAppear/viewDidDisappear: when exactly are that methods supposed to be called?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM