0
您好,我爲歌曲實體保存歌詞段數。現在我想更新歌詞核心數據與多對多關係
我用下面的代碼來更新值。但它正在創造新的紀錄..還告訴刪除
- (void)editLyrics {
[editBarbutton setTitle:@"Save"];
lyrics = [NSEntityDescription insertNewObjectForEntityForName:@"Lyrics" inManagedObjectContext:managedObjectContext];
lyrics.songLyrics = lyricsTextview.text;
lyrics.startTime = startTimeText.text;
lyrics.endTime = endTimeText.text;
lyrics.lyricsSong = song;
NSError *error;
// here's where the actual save happens, and if it doesn't we print something out to the onsole
if (![managedObjectContext save:&error])
{
NSLog(@"Problem saving: %@", [error localizedDescription]);
}
}
我m到處歌詞對象和managedobjectcontext從以前的觀點..你的代碼是不是仍然創造新的記錄 – iProgrammer 2011-10-17 12:37:00