Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS Enhance a Weather App with Table Views Next Weekโ€™s Weather Displaying Information in the Table View

William Choi
William Choi
6,121 Points

Getting an expected member name following error?

override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell { let cell = tableView.dequeueReusableCellWithIdentifier("WeatherCell") as! UITableViewCell

    let dailyWeather = weeklyWeather[indexPath.row]
    cell.textLabel?.text = dailyWeather.day

    return cell
}

on the line cell.textLabel?.text = dailyWeather.day it says that there is an expected member name following the . after textLabel? im not sure why and would like to understand whats going on. thanks in advance

Jo Albright
Jo Albright
5,199 Points

Can you explain what dailyWeather type is? The ".day" may not make sense to the computer and be throwing the error.

William Choi
William Choi
6,121 Points

To be honest I actually dont know, Ive been trying to figure out what type it is and im not to sure.

William Choi
William Choi
6,121 Points

To be honest I actually dont know, Ive been trying to figure out what type it is and im not to sure.

1 Answer

I'm honestly not sure what your exact problem is, but from a glance I feel like this line:

let cell = tableView.dequeueReusableCellWithIdentifier("WeatherCell") as! UITableViewCell

is supposed to be "as! WeatherTableViewCell" maybe?

William Choi
William Choi
6,121 Points

That wasnt it but thanks anyway, I just closed it and reopened it and now it seems to work from some reason haha