Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- static NSString *CellIdentifier = @"MusicCell";
- MusicCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
- NSUInteger currentPage = _pageControl.currentPage;
- if ([_albumsWithTracks count]) {
- if (currentPage == -1 ) {
- currentPage = 0;
- }
- Album *album = (Album *)_albumsWithTracks[currentPage];
- NSArray *tracks = album.tracks;
- cell.songTitle.text = [tracks[indexPath.row] objectForKey:ALBUM_TRACK_TITLE];
- NSString *type = [tracks[indexPath.row] objectForKey:@"type"];
- if ([type isEqualToString:@"buy"]) {
- buyButton = [[UIButton alloc] initWithFrame:CGRectMake(254, 12, 50, 25)];
- [buyButton setTitle:@"Buy" forState:UIControlStateNormal];
- [buyButton.titleLabel setFont:[UIFont systemFontOfSize:12.0f]];
- [buyButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
- [[buyButton layer] setBorderColor:[UIColor blackColor].CGColor];
- [[buyButton layer] setBorderWidth:0.5f];
- [cell addSubview:buyButton];
- }
- }
- return cell;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement