バンドルから xib とイメージにアクセスしようとしているフレームワークがあります。xib には問題なくアクセスできますが、UIImageView に画像を読み込めません。ファイルが存在し、コンソール出力が「はい」であるかどうかも確認します...
画像を読み込む方法はありますか?
フレームワークのviewcontrollerファイルにxibをロードするコード
self = [super initWithNibName:@"ViewController_iPad" bundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"MyBundle" ofType:@"bundle"]]];
画像を読み込むコード
- (void) loadImage
{
NSString *path = [[NSBundle mainBundle] pathForResource:@"MyBundle.bundle/test" ofType:@"png"];
BOOL present = NO;
present = [[NSFileManager defaultManager] fileExistsAtPath:path];
if (present)
{
NSLog(@"MyBundle.bundle/test exists");
}
else
{
NSLog(@"MyBundle.bundle/test does not exists");
}
self.testImageView.image = [UIImage imageNamed:path];
self.testImageView2.image = [UIImage imageWithContentsOfFile:path];
}
MyTestHarnessApp[11671:c07] MyBundle.bundle/test が存在します