i have done the code to show the fading of the cell when click on the Division, the code works well for the IOS 3.0 and 4.o
the code looks like
- (NSArray*)indexPathsInSection:(NSInteger)section {
NSMutableArray *paths = [NSMutableArray array];
NSInteger row;
for ( row = 0; row < [self numberOfRowsInSection:section]; row++ )
{
[paths addObject:[NSIndexPath indexPathForRow:row inSection:section]];
}
return [NSArray arrayWithArray:paths];
}
- (void)toggle:(BOOL*)isExpanded section:(NSInteger)section {
*isExpanded = !*isExpanded;
[Table beginUpdates];
if ( !*isExpanded )
{
NSArray *paths = [self indexPathsInSection:section];
[Table deleteRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationFade];
}
else {
NSArray *paths = [self indexPathsInSection:section];
[Table insertRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationRight];
}
[Table endUpdates];
[Table reloadData];
}
- (NSInteger)numberOfRowsInSection:(NSInteger)section {
if(kMAX_SECTION_ROWS[section] == 0)
{
return 1;
}
else
{
return kMAX_SECTION_ROWS[section];
}
//return 0;
}
- (void)toggleSection:(id)sender {
NSLog(@"button %d is clicked.",[sender tag]);
int i = [sender tag];
if(!isSectionExpanded[i]){
NSLog(@"expanded");
hString[i].arrowImage.image = [UIImage imageNamed:@"downarrow.png"];
}
else {
NSLog(@"not expanded");
hString[i].arrowImage.image = [UIImage imageNamed:@"arrowgrean.png"];
}
[self toggle:&isSectionExpanded[i] section:i];
}
when i run the code in IOS 5 it shows me error
Assertion failure in -[_UITableViewUpdateSupport _computeRowUpdates],/SourceCache/UIKit_Sim/UIKit-1912.3/UITableViewSupport.m:386
if any clue then reply thanks
hi friends i have got the blog where i found the source for the same which works on every ios so any one want it just go to :
http://soulwithmobiletechnology.blogspot.com/2011/06/how-does-uitableviewcell-reorder.html
i think this saves your lots of time
thanks