这段代码给了我一个漏洞——100 次迭代超过 100 mb。如果我写 [imageName release] 它会因“发送到已释放实例的消息”而崩溃。我什至想不出问题的根源是什么。
NSString* imageName=[NSString stringWithUTF8String:(const char*)sqlite3_column_text(statement, 5)];
imageName =[imageName stringByReplacingOccurrencesOfString:@"-" withString:@"_"];
imageName =[imageName stringByReplacingOccurrencesOfString:@"." withString:@"-"];
[ret setQuestionImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:imageName ofType:@"jpg"]]];