-1
我在下面的代碼的添加目標行中發現了內存泄漏,我正好釋放ui按鈕,我不知道爲什麼會發生這種情況。使用stringwithformat時發生內存泄漏
UIButton *btnProjectName = [[UIButton alloc]initWithFrame:CGRectMake(20, 10, 170, 40)];
btnProjectName.backgroundColor=[UIColor clearColor];
btnProjectName.tag=obj.tagNo;
[btnProjectName addTarget:self action:@selector(projectName_Clicked:) forControlEvents:UIControlEventTouchUpInside];
/* ... */
[btnproject release];
你發現了內存泄漏?那麼問題是什麼? – Geoffroy 2012-02-07 06:54:35
什麼類型的對象在泄漏?你是如何發現泄漏的? – bneely 2012-02-07 06:59:17
@Geoffroy,無處他使用'stringWithFormat' ..我可以知道你爲什麼將標題改爲這個嗎? – Ilanchezhian 2012-02-07 07:17:27