需要在NSNotification回调方法中进行数据库写入

问题描述

| 我调用Web服务,传递一个参数,然后在viewcontroller类中注册一个观察者(以通知下载完成):
[self callWebservice:parameter1];
[[NSNotificationCenter defaultCenter] addobserver:self    selector:@selector(dataDownloadComplete:) name:OP_DataComplete object:nil];
然后在我的解析器类中发布通知
-(void)connectionDidFinishLoading:(NSURLConnection *)connection method of the parser  class. [[NSNotificationCenter defaultCenter] postNotificationName:OP_DataComplete object:nil];
在回调方法dataDownloadComplete中:我想多次调用同一Web服务。
-(void)dataDownloadComplete
{
 if([anArray objectAtindex:N]<10)
  {
   [self callWebservice:parameterN];
   NSLog(@\"This is getting called everytime (9 times)\");
   [self writeintoDatabase];
   N++;
  }
}
但是问题是我想将我从该服务下载的数据写入数据库数据库写发生在奇怪的'parameter1 \'调用上,而对于其他参数却不对parameter9(我也需要)写。请注意,尽管日志被全部调用了9次。 writeintoDatabase代码是完美的。请帮忙。提前致谢。     

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)