Hello I am taking records from core data entity and displaying it in tableview.
My app is crashing when I view records and coming back but, not all time.
Here is my code
//load existing lyrics
- (void)loadLyricsForSong {
NSMutableArray *arrayOfLyrics = [[NSMutableArray alloc] initWithArray:[song.songLyrics allObjects]];
NSSortDescriptor *nameDescriptor = [[NSSortDescriptor alloc]initWithKey:@"startTime" ascending:YES];//name wise sorting in asecending order
NSArray *sortDescriptors = [[NSArray alloc]initWithObjects:nameDescriptor,nil];
[arrayOfLyrics sortUsingDescriptors:sortDescriptors];
[self setLyricsArray:arrayOfLyrics];//setting mutable array with places
[nameDescriptor release];
[sortDescriptors release]; //releasing objects
[arrayOfLyrics release];
[self.tableView reloadData];
}
I am calling this loadLyricsForSong method on viewWillAppear. and released lyricsArray in Dealloc method..
And exceptions are
> *** -[UITouchData retain]: message sent to deallocated instance 0x5da0860
> *** -[NSConcreteNotification retain]: message sent to deallocated instance 0x5d919b0
> *** -[CFArray retain]: message sent to deallocated instance 0x5b47d30
Please help..
Thank in advance
What does your
@propertydeclaration forlyricsArraylook like? If it is set toassignand notretainthen this code will cause a crash. Ensure that it is set toretain.