2009-07-23 121 views

回答

18

當然,只需將存儲類型設置爲NSInMemoryStoreType即可。更具體地說,你設置它是這樣的:

NSError *error = nil; 

//Ignore that it is called an "NSPersistentStore", it is not persisted 
NSPersistentStore *inMemoryStore = [persistentStoreCoorindator addPersistentStoreWithType:NSInMemoryStoreType configuration:nil URL:nil options:nil error:&error]; 

if (inMemoryStore && !error) { 
    //It is setup 
} 
+0

完美!謝謝! – Jasarien 2009-07-25 11:42:37

相關問題