0

iPad アプリ (XCode 4.6、iOS 6.2、CoreData、ARC、およびストーリーボード) があります。CoreData ストアに画像があります。

イメージを iPad の tmp ディレクトリに書き込みました。これはコードです:

    //  create a temporary file to hold the image
NSString *tmpDir = NSTemporaryDirectory();
UIImage *custImage = [UIImage imageWithData:client.aClientImage];  //  get the image
[UIImagePNGRepresentation(custImage) writeToFile:tmpDir atomically:YES];  //  write the image to tmp/file

// Create file manager
NSError *error;
NSFileManager *fileMgr = [NSFileManager defaultManager];
NSLog(@"\n\ntmp directory: %@", [fileMgr contentsOfDirectoryAtPath:tmpDir error:&error]);

NSLog には何も表示されません。

画像を含むデータを表示する UIPopover があります。CoreData ストアから画像を取得できますが、HTML では表示されません。これは私のHTMLです:

    NSString *htmlString = [NSString stringWithFormat:NSLocalizedString(@"<html> \n"
                        "<head> \n"
                        "<style type=\"text/css\"> \n"
                        "body {font-family: \"Verdana\"; font-size: 12;}\n"  //  font family and font size here
                        "</style> \n"
                        "</head> \n"
                        "<body><h2>%@ %@</h2>"
                        "<p>email: %@<p>phone: %@<p>services: %@<p><img src=\"%@\"/>"  
                        "</body> \n"
                        "</html>",nil),
                        client.aClientFirstName,
                        client.aClientLastName,
                        client.aClientEMail,
                        client.aClientPrimaryPhone,
                        appt.aServices,
                        @"tmpDir/custImage"];

画像が表示されない理由はありますか?

4

1 に答える 1