Я предполагаю, но titles
массив, созданный с чем-то вроде:
-(void) viewDidLoad(){
// this will give you an autoreleased object
titles = [NSArray arrayWithObjects:@"Foo",...];
// titles will be released once the current event is handled
// try the alloc/init style method
titles = [[NSArray alloc] initWithObjects:... ];
// this will create an array with the retain count still at 1, thus won't be released
То же самое относится к images
.
У вас есть классическая проблема управления памятью, когда вы думаете, что ссылка указывает на NSArray
, но на самом деле этот массив давно ушел и может быть заменен другим случайным другим объектом.
Для полноты:
- (void) viewDidUnload {
// clean up after your self
[titles release];
[images release];
}