1 Reply
      Latest reply: Dec 3, 2016 3:32 AM by eskimo RSS
      DeMike Level 1 Level 1 (0 points)

        When moving from the previous view controller i get this error on line "    0x101841aaf <+111>: xorl   %edi, %edi"

         

        pg`main:

            0x101841a40 <+0>:   pushq  %rbp

            0x101841a41 <+1>:   movq   %rsp, %rbp

            0x101841a44 <+4>:   subq   $0x20, %rsp

            0x101841a48 <+8>:   movq   0x86f9(%rip), %rax        ; (void *)0x0000000105439c40: globalinit_33_FD9A49A256BEB6AF7C48013347ADC3BA_token4

            0x101841a4f <+15>:  movq   0x8692(%rip), %rcx        ; (void *)0x0000000105439c3c: static Swift.CommandLine._argc : Swift.Int32

            0x101841a56 <+22>:  movl   %edi, (%rcx)

            0x101841a58 <+24>:  cmpq   $-0x1, (%rax)

            0x101841a5c <+28>:  movl   %edi, -0x4(%rbp)

            0x101841a5f <+31>:  movq   %rsi, -0x10(%rbp)

            0x101841a63 <+35>:  je     0x101841a7b               ; <+59> at AppDelegate.swift:14

            0x101841a65 <+37>:  movq   0x86dc(%rip), %rdi        ; (void *)0x0000000105439c40: globalinit_33_FD9A49A256BEB6AF7C48013347ADC3BA_token4

            0x101841a6c <+44>:  movq   0x86cd(%rip), %rax        ; (void *)0x00000001052e0ca0: globalinit_33_FD9A49A256BEB6AF7C48013347ADC3BA_func4

            0x101841a73 <+51>:  movq   %rax, %rsi

            0x101841a76 <+54>:  callq  0x10184238e               ; symbol stub for: swift_once

            0x101841a7b <+59>:  movq   0x865e(%rip), %rax        ; (void *)0x0000000105439c48: static Swift.CommandLine._unsafeArgv : Swift.UnsafeMutablePointer<Swift.Optional<Swift.UnsafeMutablePointer<Swift.Int8>>>

            0x101841a82 <+66>:  movq   -0x10(%rbp), %rcx

            0x101841a86 <+70>:  movq   %rcx, (%rax)

            0x101841a89 <+73>:  callq  0x1018418e0               ; type metadata accessor for pg.AppDelegate at AppDelegate.swift

            0x101841a8e <+78>:  movq   %rax, %rdi

            0x101841a91 <+81>:  callq  0x10184213c               ; symbol stub for: NSStringFromClass

            0x101841a96 <+86>:  movq   %rax, %rdi

            0x101841a99 <+89>:  callq  0x101842166               ; symbol stub for: objc_retainAutoreleasedReturnValue

            0x101841a9e <+94>:  xorl   %edx, %edx

            0x101841aa0 <+96>:  movl   -0x4(%rbp), %edi

            0x101841aa3 <+99>:  movq   -0x10(%rbp), %rsi

            0x101841aa7 <+103>: movq   %rax, %rcx

            0x101841aaa <+106>: callq  0x101842178               ; symbol stub for: UIApplicationMain

            0x101841aaf <+111>: xorl   %edi, %edi

            0x101841ab1 <+113>: movl   %eax, -0x14(%rbp)

            0x101841ab4 <+116>: movl   %edi, %eax

            0x101841ab6 <+118>: addq   $0x20, %rsp

            0x101841aba <+122>: popq   %rbp

            0x101841abb <+123>: retq

         

        Related

         

          self.artwork = []

                if rootJsonArray is NSArray

                {

                    for json in rootJsonArray as! [[String:AnyObject]]

                    {

                        if(hasLoadedMetaFromFirstIndex)

                        {

                            let foundArtworkTableTitle:String = json["Artwork Tableview Title"] as! String

                            let foundArtworkDetailViewTitle:String = json["Artwork Detail Title"] as! String

                            let foundArtworkThumbnail:String = json["Artwork Thumbnail"] as! String

                            let foundArtworkImage:String = json["Artwork Image"] as! String

                            let foundArtworkCaption:String = json["Artwork Caption"] as! String

                            var foundArtworkVideos:[TourArtworkVideo] = []

                            if let videos = json["Artwork Videos"] as? [[String:AnyObject]]

                            {

                                for video in videos

                                {

                                    foundArtworkVideos.append(TourArtworkVideo(videoTitle: video["Video Title"] as! String, videoFilePath: video["Video File"] as! String))

                                }

                            }

                            self.artwork.append(TourArtwork(artworkTitle: foundArtworkTableTitle, artworkDetailTitle: foundArtworkDetailViewTitle, artworkThumbnail: foundArtworkThumbnail, artworkImage: foundArtworkImage, artworkCaption: foundArtworkCaption, artworkVideos: foundArtworkVideos))

                        }

                        else

                        {

                            self.navigationItem.title = json["Exhibition Title"] as? String

                            hasLoadedMetaFromFirstIndex = true

                        }

                    }

                }

            }

        }

         

         

         

        self.tourSetData = []

                if rootJsonArray is [[String:AnyObject]]

                {

                    for json in rootJsonArray as! [[String:AnyObject]]

                    {

                        if (json["id"] as! Int) == tourSetPointer

                        {

                            if let tours = json["content"] as? [[String:AnyObject]]

                            {

                                for tours in tours

                                {

                                    let image:String = tours["image"] as! String

                                    let link:String = tours["link"] as! String

                                    let button:String = tours["button"] as! String

                                    let displayType:String = tours["Display Type"] as! String

                                    if displayType == "Grid"

                                    {

                                        tourSetData.append(Tour(tourCoverPhoto: image, tourBeginButtonText: button, tourBeginButtonLink: link, tourDisplayType: TourDisplayType.gridView))

                                    }

                                    else if displayType == "Table"

                                    {

                                        tourSetData.append(Tour(tourCoverPhoto: image, tourBeginButtonText: button, tourBeginButtonLink: link, tourDisplayType: TourDisplayType.tableView))

                                    }

                                    else

                                    {

                                        tourSetData.append(Tour(tourCoverPhoto: image, tourBeginButtonText: button, tourBeginButtonLink: link, tourDisplayType: TourDisplayType.none))

                                    }

                                }

                            }

                        }

                    }

                }

            }

         

            func addBackButton()

            {

                let button = UIButton(frame: CGRect(x: 0, y: 0, width: 65, height: 35))

                button.setTitle("Back", for: UIControlState())

                button.setBackgroundImage(UIImage(named: "Button.png"), for: UIControlState())

                button.setTitleColor(UIColor.black, for: UIControlState())

                button.alpha = 0.75

                button.titleLabel?.font = UIFont(name: "Avenir-Book", size: 17)

                button.addTarget(self, action: #selector(ViewControllerTours.backButtonClicked(_:)), for: UIControlEvents.touchUpInside)

                self.view.addSubview(button)

                self.view.bringSubview(toFront: button)

            }

        }

         

         

        class VideoController : NSObject

        {

            func playVideo(_ view:UIViewController, navn:String, type:String)

            {

                let path = Bundle.main.path(forResource: navn, ofType: type)

                let videoURL = URL(fileURLWithPath: path!)

              

                let player = AVPlayer(url: videoURL as URL)

                player.play()

            }

        }

        • Re: Thread 1: EXC_BAD_INSTRUCTION (code=EXC_13860INVOP,subcode=0x0)
          eskimo Apple Staff Apple Staff (6,995 points)

          EXC_BAD_INSTRUCTION is usually caused by two things:

          • You’ve jumped (via a function pointer, or method dispatch with a corrupt object, or by smashing the stack, or whatever) to invalid code

          • You’ve hid an invalid opcode (typically ud2) inserted by the compiler as a trap mechanism

          When writing Swift code the latter is by far the most common.  In this case it typically means that one of the Swift safety checks has failed, for example:

          • Accessing a nil optional

          • Accessing out of bounds on an array

          • Integer truncation, like trying to put an out of range value into a UInt8

          It’s hard to say what’s actually failing without a better backtrace.  In Xcode, go to the Debug Navigator, find the thread that crashed, and look at its full backtrace.

          Share and Enjoy

          Quinn “The Eskimo!”
          Apple Developer Relations, Developer Technical Support, Core OS/Hardware
          let myEmail = "eskimo" + "1" + "@apple.com"