开发者

can't able to handle UIActions from subclasses

I am creating a class for soap webservice to get some information from .net webserver.

for that i am using NSMutableURLRequest and parse the result using NSXmlParse开发者_C百科r.

Now i am calling that web services class from myviewcontroller.m class like this.

    mywebserviceClass *obj=[[mywebserviceClass alloc] init];
[obj mymethod];

i am adding result to an array to use that array details in myviewcontroller.m class.

but i did n't get details into array while i am using that array immediately after this method.

i am trying like this by calling another method after 2 sec to use that array like this.

[self performSelector:@selector(myanotherMethod) withObject:nil afterDelay:2]; 

i know the reason why it is, it takes time to parse.

I am trying another way like i am creating object for viewcontroller and call this method like this.

myviewcontroller *obj=[[myviewcontroller alloc] init];
[obj myanothermethod];

NOw i can able to get details but i can't able to handle UIActivities like raising alerts.

While as told in the above performSelector method i can able to handle all UIActivities.

But i need to call that method after completion of parsing of result.

Can any one please help me.

Thank you.


Call your web service in viewDidLoad/ViewWillAppear methods of UIViewController. Collect your data and then call Parse method like- [self performSelectorOnMainThread:@selector(methodName) waitUntilDone:YES]; Below that use your array to display view or if you are displaying in table view then just call [mytblviewobj reloadData];

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜