【问题标题】:Program received signal: “0”节目接收信号:“0”
【发布时间】:2010-02-12 15:41:38
【问题描述】:

想实现像Season's Greetinghttp://itunes.apple.com/us/app/seasons-greeting/id345499393?mt=8这样的应用程序

但是当我在 UIScrollView 中添加多个图像视图时出现以下错误:

程序接收信号:“0”警告:check_safe_call:无法恢复当前帧

我已经将图像添加为 .png 文件,并且我也使用过

[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"Template1"]
                                           ofType:@"png"]; 
UIImage* templateImg = [UIImage imageWithContentsOfFile:templateName]; 
[templateArray addObject:templateImg];
UIImageView* imgView = [[UIImageView alloc] initwithimage:templateImg]; 
[scrollView addSubview:imgView];

当我如上所述添加 25 imgView 时,我的应用在 iPhone 模拟器和 iPhone 上崩溃了。

查看崩溃日志,设备似乎在抱怨内存不足。对我来说,显示此行为的代码仅在 3.0 上显示。这在 2.x 上从未发生过,代码完全相同。

【问题讨论】:

    标签: iphone


    【解决方案1】:

    在Instruments 下运行您的应用,看看您实际使用了多少内存。听起来你肯定用完了。

    限制内存使用的一种方法是在滚动视图中使用延迟加载:仅加载和显示那些实际可见的图像视图。

    【讨论】:

      猜你喜欢
      • 2011-03-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-10-06
      相关资源
      最近更新 更多