swift - Tab bar not working when clicking second tab -


i having problem tab bar controller! upon simulation of project, tab bar controller appears, first tab selected, , showing view have put in first tab (so correct). when click on second tab, takes me xcode , displays "thread 1: signal sigabrt" @ top of appdelegate class. have no idea why happening other maybe isnt linked correctly. can go on steps link view controller second tab of tab bar controller? thanks!

all have in storyboard of second scene 2 labels, switch, slider, , button. because need worry values of switch , label, 2 things have connected code using outlets.

1. tab bar controller 1 view controller

enter image description here

2. add second view controller uilabel

enter image description here

3. ctrl + drag tab bar controller second view controller

enter image description here

4. choose relationship segue -> view controllers

enter image description here

5. tab bar controller 2 view controllers

enter image description here

6. result

enter image description here

7. access labels etc., create file second view controller, in example secondviewcontroller.swift inherits uiviewcontroller

import uikit  class secondviewcontroller: uiviewcontroller {  } 

8. in storyboard second view controller selected, set custom class in identity inspector , hit return

enter image description here

9. connect ui element file , access it, ctrl + drag e.g. uilabel file , give name, in case randomtextlabel

enter image description here

10. change label in secondviewcontroller.swift e.g. in viewdidload

import uikit  class secondviewcontroller: uiviewcontroller {    @iboutlet weak var randomtextlabel: uilabel!    override func viewdidload() {     super.viewdidload()     randomtextlabel.text = "changed label text"   } } 

11. result changed uilabel

enter image description here


Comments

Popular posts from this blog

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

jsf - "PropertyNotWritableException: Illegal Syntax for Set Operation" error when setting value in bean -

arrays - Algorithm to find ideal starting spot in a circle -