Add UILabel to iPhone

I have a tableView that displays a list of songs when I click on the one that it plays.

-(void) PlaySelectedSong:(id) sender{       
Song *aSong=[aCategory.Items objectAtIndex:appDelegate.selectedSong];
NSString *content1=[[NSString alloc] initWithFormat:@"http://192.168.50.108:8888/%@",[aSong.Link stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]];

NSLog(content1);
NSURL *url=[NSURL URLWithString:content1];

NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];

//Load the request in the UIWebView.
webView.delegate=self;
[webView loadRequest:requestObj]; 

}

Here's how to play it. The problem is that the song URL is displayed during playback. I plan to add an inscription above it. so that I can set the text labels to the name of the song.

How to add a shortcut to do the same. Anyone knows. Help is needed.

Thanks Shibin

+3
source share
1 answer

Actually, additional information is needed to answer the question, but it looks like you want to have two text fields in the table view.

When creating, UITableViewCellcreate it using the style UITableViewCellStyleSubtitle.

cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle
                               reuseIdentifier:cellIdentifier] autorelease];

Then you can specify the subtitles in the cell to be displayed with

cell.textLabel.text = songTitle;
cell.detailTextLabel.text = songUrl;
+2
source

Source: https://habr.com/ru/post/1730147/


All Articles