ios后臺處理數據存儲線程
來源:易賢網 閱讀:1204 次 日期:2014-12-08 14:06:27
溫馨提示:易賢網小編為您整理了“ios后臺處理數據存儲線程”,方便廣大網友查閱!

在類中,進行編輯下面的代碼:

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... );

[pool release];

}

更多信息請查看IT技術專欄

更多信息請查看技術文章
易賢網手機網站地址:ios后臺處理數據存儲線程
關于我們 | 聯系我們 | 人才招聘 | 網站聲明 | 網站幫助 | 非正式的簡要咨詢 | 簡要咨詢須知 | 新媒體/短視頻平臺 | 手機站點

版權所有:易賢網