2012-10-16 35 views
0

在我的應用我使用coredata存儲有關文檔的詳細核心數據數據庫的內容如何NSLog的

這裏是我的代碼

-(void)writeToDatabase:(UIManagedDocument *)newdocument 
    { 
    Images *image =[NSEntityDescription insertNewObjectForEntityForName:@"Images" inManagedObjectContext:newdocument.managedObjectContext]; 
     image.album = @"Album 1"; 
     image.date = @"October"; 
     image.share = @"Not shared yet"; } 

在上面的代碼

1.Images is the core data entity. 

    2.I have inserted data in this fashion(temporarily) just to check. 

我怎樣才能NSLog的值?

+0

@Ravi:我會記住... thanx :) – icodes

回答

0

試試這個,

假設在coredata屬性值都是字符串

NSLog(@"Image Name %@",image.album); 
NSLog(@"Data %@",image.date); 
NSLog(@"Share Name %@",image.share); 

希望它能幫助。