ios - 线程 1:EXC_BAD_ACCESS(代码=2,地址=0x1083cfea8)
问题描述
当我添加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
查看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
解决方案
转到storyBoard并选择您的视图carouselView并将“AACarousel”设置为此课程。
推荐阅读
- ruby-on-rails - 简单的 if 语句到 Ruby 中的 Tenerary
- azure - Azure AD B2C 门户不会保存我的重定向 uri
- reactjs - React - 具有动态、受控元素的表单
- python - 如何在 Windows 10 中为 python 添加 os.environ["PATH"] 的路径?
- javascript - doc.createParagraph 不是函数 - docx
- json - 为什么 JSON_TABLE() 加入不一致?
- django - Django搜索空值,验证
- c++ - Debian 上的 Armel 交叉编译(工具链存储库问题)
- ajax - 在发出 Ajax 请求以加载数据时,有没有办法在 Rally Grid(ext JS)中显示“正在加载数据..”选项?
- python - 使用 Pandas 循环遍历列