【发布时间】:2010-02-15 17:32:44
【问题描述】:
问题可能是直截了当的,但我不明白。
我有以下 iPhone 代码
for(int x = 0 ; x < [allFriends count] ; x++)
{
Friend *f = [[Friend alloc] init];
f = [allFriends objectAtIndex:x];
if([uid isEqualToString:[f uid]])
{
[f AddAlbum:album];
[allFriends replaceObjectAtIndex:x withObject:f];
}
}
无论我在哪里调用 [f release],应用程序总是崩溃。为什么? (顺便说一句,循环运行了几千次)
有没有更有效的方法?
我想我提供了足够的代码,如果没有,请告诉我!
非常感谢您的帮助!
【问题讨论】:
-
谢谢大家!更改了它,它现在可以工作了!
标签: iphone objective-c arrays pointers