0

私のアプリではcoredata、ドキュメントに関する詳細を保存するために使用しています

これが私のコードです

-(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値を取得できますか?

4

1 に答える 1

0

これを試して、

coredata の属性値が文字列であると仮定します

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

それが役に立てば幸い。

于 2012-10-16T14:34:18.043 に答える