7

Tôi đang cố gắng kết nối CoreData với iCloud bằng NSFetchedResultController dựa trên iCloud example.FetchResultController delegate - cảnh báo kiểu không tương thích

NSFetchedResultsController *aFetchedResultsController = [[NSFetchedResultsController alloc] initWithFetchRequest:fetchRequest managedObjectContext:self.managedObjectContext sectionNameKeyPath:@"date" cacheName:@"Root1"]; 
aFetchedResultsController.delegate = self; 

Tuy nhiên tôi nhận được cảnh báo như trên dòng thứ hai: cảnh báo: Issue Semantic: Đi qua 'RootViewController * const __strong' để tham số của không tương thích kiểu 'id'. Tôi nghĩ rằng thiết lập đại biểu cho bản thân nên được ok, nhưng nó không phải. Ai cũng có thể giúp?

+2

Làm cho 'RootViewController' tuân theo giao thức' NSFetchedResultsControllerDelegate'. – albertamg

+1

Lớp của bạn có triển khai giao thức 'NSFetchedResultsControllerDelegate' không? –

Trả lời

8

Làm cho RootViewController tuân theo giao thức NSFetchedResultsControllerDelegate.

@interface RootViewController : UIViewController <NSFetchedResultsControllerDelegate> 
+0

Oh gosh, hiển nhiên :) Cảm ơn bạn đã chỉ ra! – Vive

Các vấn đề liên quan