小编use*_*778的帖子

iPhone SDK:主包内的子文件夹

在当前项目中,我有许多文件夹,包含子文件夹,其中包含图像:01.png,02.png.

Folder1/FolderA/f1.png Folder1/FolderB/F1.png

当我编译应用程序时,我查看了.app并注意到所有图像都放在顶层,没有子文件夹.

因此在尝试加载图像时这显然不起作用:

NSString*filePath = [[NSBundle mainBundle] pathForResource:@"f1"ofType:@"png"inDirectory:@"Folder1/FolderA"];

但更奇怪的是,当加载图像"f1"时,图像实际加载"F1"

UIImageView*imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"f1.png"]];

任何人都有关于如何解决这个问题的想法?

是否有编译选项在应用程序包中创建文件夹?

TIA.

iphone directory uiimageview

10
推荐指数
1
解决办法
8070
查看次数

创建多页PDF时出错

有人已经在iPad应用程序中创建了PDF文档吗?我看到UIKit中有新功能来执行此操作,但我找不到任何代码示例.

BOOL UIGraphicsBeginPDFContextToFile (
   NSString *path,
   CGRect bounds,
   NSDictionary *documentInfo
);

void UIGraphicsBeginPDFPage (
   void
);
Run Code Online (Sandbox Code Playgroud)

我找到了一个可以在iPhone上运行的例子,但这给了我错误:

Fri Apr 30 11:55:32 wks104.hs.local PDF[1963] <Error>: CGFont/Freetype: The function `create_subset' is currently unimplemented.
Fri Apr 30 11:55:32 wks104.hs.local PDF[1963] <Error>: invalid Type1 font: unable to stream font.
Fri Apr 30 11:55:32 wks104.hs.local PDF[1963] <Error>: FT_Load_Glyph failed: error 6.
Fri Apr 30 11:55:32 wks104.hs.local PDF[1963] <Error>: FT_Load_Glyph failed: error 6.
Fri Apr 30 11:55:32 wks104.hs.local PDF[1963] <Error>: FT_Load_Glyph failed: error 6.
Fri Apr …
Run Code Online (Sandbox Code Playgroud)

pdf-generation multipage ipad

0
推荐指数
1
解决办法
9148
查看次数