(前回)Cocoaの日々: CoreData - リレーションシップ(4) タグを使った検索 前回までは多対多のリレーションシップでを扱ったが、今回は一般的なマスター・ディティール(1対多)を扱ってみる(順番でいけばこっちの方を先に試すべきだったかもしれない)。 まず BlogComment というモデルを追加し、BlogEntry と関連づける。 設定。 BlogComment.entry は、必須(非オプション)、削除ルール=カスケード、としておく。 コメント登録コード: -(void)addComment{ NSManagedObjectContext* moc = [self managedObjectContext]; // (1) fetch from BlogEntry NSFetchRequest* request = [[NSFetchRequest