我創建可用於設置文本的UITextView一個的NSString:完成使用後,您是否必須解除分配NSString *對象?
for (int score = 0; score < 100; score++){
NSString *newScore = [NSString stringWithFormat:@"Score: %d", score];
[_scoreText setText:newScore];
}
我的問題是:循環完成後,我會在內存中有100個對象,我必須手動解除分配,或者將ObjectiveC在我們離開循環範圍後自動清理垃圾?
您是否在使用ARC? – yeesterbunny
如何檢查?我正在使用Xcode 4.3.6併爲iOS 5+開發 –
http://stackoverflow.com/questions/11380533/how-do-i-know-if-my-program-has-arc-enabled-or-not – yeesterbunny