メモリ不足の警告を4回発した後、機器がメモリリークを表示していないのに、メモリ割り当てでライブが動作しています。4.7MBに上がり、すべてのバイトが79.0 MBまで上がります。すべてのヘルプは非常にリークすることなく、メモリ使用量を増やすメモリ不足の警告後にアプリケーションがクラッシュする
for (int i = 0; i<3; i++)
{
UIImage *rendered_image;
UIGraphicsBeginImageContextWithOptions(sub_view.bounds.size, NO, 0.0);
[appdelegate.arrimages removeAllObjects];
[appdelegate.arranimations removeAllObjects];
NSString *oldgroup = [[NSString alloc] init];
NSString *currentgroup = [[NSString alloc] init];
for(int i=0; i<[sub_view.data count]; i++)
{
oldgroup = (i>0) ? [sub_view.group objectAtIndex:(i-1)] : [sub_view.group objectAtIndex:i];
currentgroup = [sub_view.group objectAtIndex:i];
/*
IF DIFFERENT GROUP NAME RECEIVED
1-GET NEW INSTANCE OF IMAGE
2-SAVE PREVIOUS IN ARRAY
*/
if (![oldgroup isEqualToString:currentgroup])
{
rendered_image = UIGraphicsGetImageFromCurrentImageContext();
[self SaveImagesOfAnimation:[self compressImageDownToPhoneScreenSize:rendered_image]];
[appdelegate.arranimations addObject:[sub_view.anim objectAtIndex:i]];
UIGraphicsEndImageContext();
UIGraphicsBeginImageContextWithOptions(sub_view.bounds.size, NO, 0.0);
}
id element = [sub_view.data objectAtIndex:i];
color = [sub_view.fillColor objectAtIndex:i];
[color setFill];
[element fill];
[[UIColor blackColor] setStroke];
[element stroke];
}
rendered_image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
[self SaveImagesOfAnimation:[self compressImageDownToPhoneScreenSize:rendered_image]];
}
インストゥルメントには、割り当てたオブジェクトの種類と正確なスタックトレースが表示されるため、すぐに把握できるはずです。 – Costique
このリンクを確認するhttp://stackoverflow.com/questions/6425043/how-i-can-display-an-alert-when-i-received-memory-warning-level-2-in-iphone-sdk/6425084# 6425084 –