2011-12-13 47 views
3

这是我的情况:我有很多位图图像(高分辨率)。我想用Airprint打印这些图像。我找到了打印图像的方法。Airprint中的内存管理(ios)

NSArray array = {image1, image2, image3, image4..... image100} 
UIPrintInteractionController *pic; 
pic.printingItems = array; 

所以,我知道这是可能的。

但是!!这种方法使用了大量的内存。由于我想打印许多图像,并且数组的大小越来越大,我不能使用这种方法。所以,我想知道如何在Airprint中打印许多图像。

是否有像这样的回调函数?

Airprint says : "give me a next printing image" and then i can give an image. 
+0

检查此答案我已发布[link] [1]。它可能会帮助您 。 [1]:http://stackoverflow.com/questions/5690931/objective-c-code-for-airprint/12052720#12052720 – Shantanu

回答

0

你可以制作自己的图像类,也许?使用Objective C,您不一定需要从基本UIImage开始。你可以做一些像UIImage一样的东西,但更好地处理内存。

+0

我真的很抱歉。我不明白 – dh0rmfpdlxm

+0

我在说,让自己的类实现与UIImage相同的功能,使用相同的方法名称。 (例如它实现-imageOrientation和-size和-scale)使其更有效地使用内存。然后用你自己班的对象而不是UIImages填充你的NSArray。 – StilesCrisis

+0

谢谢,但如果我有很多图像,我认为这种方法(您的建议)仍然需要大量的内存。有没有其他的方法? :' - ( – dh0rmfpdlxm