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 trialMateo Sossah
6,598 PointsI have the same code as the video, but am getting tons of errors on a single line
For "let playlistImageView = playlistsArray[index]" I get these errors
- type of expression is ambiguous without more context
- type annotation missing in pattern
- definition conflicts with previous value
- consecutive statements on a line must be separated by ";"
import UIKit
class PlaylistMasterViewController: UIViewController {
var playlistsArray: [UIImageView] = []
@IBOutlet weak var playlistImageView0: UIImageView!
override func viewDidLoad() {
super.viewDidLoad()
playlistsArray.append(playlistImageView0)
for index in 0..<playlistsArray.count {
let playlist = Playlist(index: index)
let playlistImageView = playlistsArray[index]
playlistImageView.image = playlist.icon
playlistImageView.backgroundColor = playlist.backgroundColor
}
}
1 Answer
Mateo Sossah
6,598 PointsHey Steven, I'm not really sure what I did (simply made the block look "cleaner" without touching the code) but it worked...
I guess I'll delete the question, but thanks for taking a look!
Steven Deutsch
21,046 PointsSteven Deutsch
21,046 PointsHey Mateo,
Can you show me the code for your prepareForSegue method?