首页 > 解决方案 > 线程 1:EXC_BAD_ACCESS(代码=2,地址=0x1083cfea8)

问题描述

当我添加paperOnboardingpod 时,构建并运行我的 swift 程序。成功后,我的应用程序崩溃并出现了线程。寻求帮助以解决此问题。太感谢了。

在此处输入图像描述

线程 1:ViewController.viewDidload

 //titleArray = ["picture 1","picture 2","picture 3","picture 4","picture 5","picture 6","picture 7","picture 8","picture 9","picture 10","picture 11"]
    carouselView.delegate = self
    carouselView.setCarouselData(paths: pathArray,  describedTitle: titleArray, isAutoScroll: true, timer: 3.0, defaultImage: "defaultImage")
    //optional method
    carouselView.setCarouselOpaque(layer: true, describedTitle: false, pageIndicator: true)
    carouselView.setCarouselLayout(displayStyle: 2, pageIndicatorPositon: 2, pageIndicatorColor: UIColor.gray, describedTitleColor: nil, layerColor: nil)
}

线程 1:34 UIApplication Main

  0x109aa4057 <+159>: movq   0x115b602(%rip), %rbx     ; (void *)0x0000000108319d00: objc_release

线程 1:35 主要

class AppDelegate: UIResponder, UIApplicationDelegate {

线程 1:36 主要

  0x10e822955 <+1>: movl   %eax, %edi

查看Didload

 @IBOutlet weak var carouselView: AACarousel!

var titleArray = [String]()

override func viewDidLoad() {
    super.viewDidLoad()

    let pathArray = [
                    //array of images here               

    ]


   carouselView.delegate = self
   carouselView.setCarouselData(paths: pathArray,  describedTitle: titleArray, isAutoScroll: true, timer: 3.0, defaultImage: "defaultImage")
   // optional method
   carouselView.setCarouselOpaque(layer: true, describedTitle: false, pageIndicator: true)
   carouselView.setCarouselLayout(displayStyle: 2, pageIndicatorPositon: 2, pageIndicatorColor: UIColor.gray, describedTitleColor: nil, layerColor: nil)
}

func startAutoScroll() {
    //optional method
    carouselView.startScrollImageView()

}

func stopAutoScroll() {
    //optional method
    carouselView.stopScrollImageView()
}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

AppDelegate.swift

这是我的“AppDelegate.swift”文件的初始部分“KingFisher”是我添加的唯一代码。

import UIKit
import Kingfisher

标签: iosswift

解决方案


转到storyBoard并选择您的视图carouselView并将“AACarousel”设置为此课程。


推荐阅读