Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios 如何在xcode 6中使用分配工具_Ios_Objective C_Xcode6_Instruments_Allocation - Fatal编程技术网

Ios 如何在xcode 6中使用分配工具

Ios 如何在xcode 6中使用分配工具,ios,objective-c,xcode6,instruments,allocation,Ios,Objective C,Xcode6,Instruments,Allocation,嗨,我做了以下代码 - (void)viewDidLoad { [super viewDidLoad]; NSMutableArray *arr = [[NSMutableArray alloc] init]; NSString *str = @"ok"; int count=0; while (count < 20) { count++; [arr addObject:str]; NSLog

嗨,我做了以下代码

- (void)viewDidLoad {

   [super viewDidLoad];
    NSMutableArray *arr = [[NSMutableArray alloc] init];
    NSString *str = @"ok";

    int count=0;
    while (count < 20)
    {
        count++;
        [arr addObject:str];
        NSLog( @"arr is %@",arr );
        if (count == 200)
        {
            NSLog(@"out");
            break;
        }
    }
 }
-(void)viewDidLoad{
[超级视图下载];
NSMutableArray*arr=[[NSMutableArray alloc]init];
NSString*str=@“确定”;
整数计数=0;
同时(计数<20)
{
计数++;
[arr addObject:str];
NSLog(@“arr为%@”,arr);
如果(计数=200)
{
NSLog(@“out”);
打破
}
}
}

而且我的记忆也在无限增长。如何通过仪器找到它?提前谢谢。

为什么要对
自动释放
d对象调用
release
?我禁用了ARC以了解仪器如何工作。@murali,[NSArray array]返回自动释放的对象,所以在任何情况下都不应该释放它。好的,我刚刚修改了代码。但它仍然给出了无限的内存增长图该视图加载的频率是多少?