- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
@try {
NSMutableArray *items = nil;
if(isGrouped){
items = [NSMutableArray arrayWithArray:[_sortedItemsDict objectForKey:[_alphabet objectAtIndex:section]]];
}else{
items = _itemsArray;
}
[cell.textLabel setText:[[items objectAtIndex:row] name]?[[items objectAtIndex:row] name]:@"No Title"];
if([[items objectAtIndex:row] isKindOfClass:[Song class]]){
Song *song = (Song*)[items objectAtIndex:row];
[cell.detailTextLabel setText:[NSString stringWithFormat:@"%@ %@", [song albumName]?[song albumName]:[NSString string], [song artistName]]?[song artistName]:[NSString string]];
if([song isAvailableAtItunes])
NSLog(@"%@ %d", [song name], [song ID]);
[cell setTag:[song ID]];
}else if([[items objectAtIndex:row] isKindOfClass:[Album class]]){
[cell.detailTextLabel setText:[NSString stringWithFormat:@"%@", [[items objectAtIndex:row] artistName]]?[[items objectAtIndex:row] artistName]:[NSString string]];
}else if([[items objectAtIndex:row] isKindOfClass:[Podcast class]] || [[items objectAtIndex:row] isKindOfClass:[Audiobook class]]){
[cell setTag:[[items objectAtIndex:row]ID]];
}
if(!isFromSelfLibrary){
if(items && ([[items objectAtIndex:row] isKindOfClass:[Song class]] || [[items objectAtIndex:row] isKindOfClass:[Podcast class]] || [[items objectAtIndex:row] isKindOfClass:[Audiobook class]])){
if([[items objectAtIndex:row]isAvailableAtItunes]){
for(UIView *view in [cell subviews]){
if(view.tag == 111){
[view setHidden:NO];
}
}
}else{
[[DataController instance] checkItem:[items objectAtIndex:row]];
}
[cellsDict setValue:cell forKey:[NSString stringWithFormat:@"%d",[cell tag]]];
}
}
if(items && ![[items objectAtIndex:row] isKindOfClass:[Song class]]
&& ![[items objectAtIndex:row] isKindOfClass:[Podcast class]]
&& ![[items objectAtIndex:row] isKindOfClass:[Audiobook class]])
{
[cell setAccessoryType:UITableViewCellAccessoryDisclosureIndicator];
}
[cell.textLabel setTextColor:[UIColor whiteColor]];
[cell.textLabel setShadowColor:[UIColor blackColor]];
[cell.textLabel setShadowOffset:CGSizeMake(0, 1)];
[cell.detailTextLabel setTextColor:[UIColor lightGrayColor]];
[cell.detailTextLabel setShadowOffset:CGSizeMake(0, 1)];
[cell.detailTextLabel setShadowColor:[UIColor blackColor]];
[tableView deselectRowAtIndexPath: indexPath animated: YES];
}
@catch (NSException *exception) {
NSLog(@"olo1");
}
Не то, чтобы отлов исключения меня печалит.... :'(
istem 09.12.2011 00:25 # +1
Lure Of Chaos 09.12.2011 11:41 # 0
shoumikhin 01.02.2012 13:49 # −1
lime 01.02.2012 13:55 # 0
shoumikhin 01.02.2012 14:06 # 0
lime 01.02.2012 14:13 # 0
guest8 09.04.2019 12:19 # −999