So, I create an array:
TorrentItem[] torrents = new TorrentItem[10];
The TorrentItem control has a method called SetTorrentName(string name):
private void SetTorrentName(string Name)
{
label1.Text = Name;
}
I'm using a for loop to populate 10 TorrentItems like so:
private TorrentItem[] GetTorrents()
{
TorrentItem[] torrents = new TorrentItem[10];
string test = "";
for (int i = 0; i < 10; i++)
{
test = i.ToString();
TorrentItem[i].SetTorrentName(test); //I get a null reference error here.
//What am I doing wrong?
}