4 Replies
      Latest reply on Jul 22, 2019 1:32 AM by net777
      net777 Level 1 Level 1 (0 points)

        I am a beginner and I´m following a course.

        They use a project where the labels an so on where already set.

        I wanted to make some changes but when I run the app they doesn't show.

        • Re: Changes not showing at runtime
          Claude31 Level 8 Level 8 (7,225 points)

          You should show the code you have written, otherwise it is nearly impossible to tell.

           

          What you should have:

           

          - labels defined in Interface builder (IB) by dragging a UILabel into the view controller

          - IBOutlets defined in code for those labels

              @IBOutlet weak var myLabel: UILabel!

           

          - connected the labels in IB to the IBOutlets in code

           

          When you want to change the value, stored in a var

          var newText = "The label has changed"

           

          you update the label with a statement as:

          self.myLabell.text = newText

           

          But once again, please post your exact code.

          • Re: Changes not showing at runtime
            KMT Level 9 Level 9 (15,205 points)

            Xcode loves to hold onto things, so those changes may not be picked up right away.

             

            Use the 'Product' menu w/the option key pressed, choosing to 'clean build folder', then try again.

             

            Still no joy, redo the connections for those labels in IB, also followed by an option-clean build folder.

             

            And finally, under the assumption you are using the latest 10.2.1 Xcode, be sure you've not adopted an older project that is simply no longer compatible...you risk wasting your time trying to fit bandaids instead of learning. Always effort to work with the very latest samples you can find.