Thanks in advance for the help.
Total noob here trying to figure out
and I keep getting an error that has me completely stumped.
keeps returning a
error on
and I can't possibly figure out what the problem is after days of searching. Code below.
Total noob here trying to figure out
Code:
UITableView
Code:
AppDelegate.swift
Code:
Thread 1: signal SIGABRT
Code:
class AppDelegate: UIResponder, UIApplicationDelegate
Code:
AppDelegate.swift
Code:
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
returntrue
}
func applicationWillResignActive(application: UIApplication) {
}
func applicationDidEnterBackground(application: UIApplication) {
}
func applicationWillEnterForeground(application: UIApplication) {
}
func applicationDidBecomeActive(application: UIApplication) {
}
func applicationWillTerminate(application: UIApplication) {
}
}
Code:
ViewController.swift
Code:
import UIKit
class ViewController: UIViewController, UITableViewDelegate, UITableViewDataSource {
var cellContent = ["1", "2", "3", "4"]
@IBOutletweakvar tableView : UITableView!
overridefunc viewDidLoad() {
super.viewDidLoad()
tableView.delegate = self
tableView.dataSource = self
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
returncellContent.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell")
cell.textLabel?.text = cellContent[indexPath.row]
return cell
}
overridefunc didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}