首页 > 网站 > 建站经验 > 正文

ios后台处理数,据存储线程

2019-11-02 14:49:31
字体:
来源:转载
供稿:网友

 在类中,进行编辑下面的代码:

NSLog(@"main thread begin...");

[self performSelectorInBackground:@selector(doSomething:) withObject:nil];

NSLog(@"main thread end.....");


- (void) doSomething:(id)sender

{

NSLog( @"one thread begin..." );

NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

for (int i=0; i<self.StarName_Final.count; i++) {

[self SaveToDataBase:[StarName_Final objectAtIndex:i]];

}

NSLog( @"one thread end...

其它电影[www.aikan.tv/xzhtml/9/]
" );

[pool release];

}

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表