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]返回自动释放的对象,所以在任何情况下都不应该释放它。好的,我刚刚修改了代码。但它仍然给出了无限的内存增长图该视图加载的频率是多少?