【问题标题】:Thread 1: EXC_BAD_ACCESS (code=2, address=0x1083cfea8)线程 1:EXC_BAD_ACCESS(代码=2,地址=0x1083cfea8)
【发布时间】:2019-01-04 05:37:25
【问题描述】:

当我添加 paperOnboarding pod 后,构建并运行我的 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

ViewDidload

 @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

【问题讨论】:

  • 不要发布截图,而是发布代码。
  • 抱歉没有贴出代码
  • @pchocoios 你初始化carouselView了吗?
  • 是的,我已经初始化了。
  • 在控制台中显示错误信息。

标签: ios swift


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 2015-10-07
    • 2020-11-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-12
    • 1970-01-01
    • 2018-03-13
    • 2013-10-11
    相关资源
    最近更新 更多