我是IOS开发新手,处理内存泄漏。在我的项目分析项目时,我得到了一些内存泄漏。但我无法修复下面的代码中的以下逻辑错误。“参数包含未初始化的数据”设置框时
CGRect labelframe;
if ([questonmod.questionType isEqualToString:@"type1"])
{
nooflinesint=questonmod.questiontext.length/20;
if (nooflinesint<1)
{
nooflinesint=nooflinesint+2;
}
else
{
nooflinesint=nooflinesint+1;
}
labelframe= CGRectMake(5, 0, cell.frame.size.width-10, nooflinesint*18);
}
else if([questonmod.questionType isEqualToString:@"type2"])
{
nooflinesint=questonmod.questiontext.length/10;
if (nooflinesint<1)
{
nooflinesint=nooflinesint+2;
}
else
{
nooflinesint=nooflinesint+1;
}
labelframe= CGRectMake(5,0,cell.frame.size.width-155,nooflinesint*16);
}
cell.questionlabel.frame=labelframe; //at this line I got below error.
我得到“合格按值结构参数包含未初始化数据(例如,经由现场链:‘origin.x’)”的错误描述。
请建议我该如何解决上述问题..
在此先感谢..
您使用ARC? – Aly
@Aly ...是的我正在使用ARC。 – Vidhyanand