Open GodLiek opened 3 days ago
ZLEditVideoViewController.m第408行,为啥要这么写timer = Timer.scheduledTimer(timeInterval: duration, target: ZLWeakProxy(target: self), selector: #selector(playPartVideo), userInfo: nil, repeats: true),我这边跑起来会崩溃,改成这样就没问题:timer = Timer.scheduledTimer(timeInterval: duration, target: ZLWeakProxy(target: self).target, selector: #selector(playPartVideo), userInfo: nil, repeats: true)
timer = Timer.scheduledTimer(timeInterval: duration, target: ZLWeakProxy(target: self), selector: #selector(playPartVideo), userInfo: nil, repeats: true)
timer = Timer.scheduledTimer(timeInterval: duration, target: ZLWeakProxy(target: self).target, selector: #selector(playPartVideo), userInfo: nil, repeats: true)
ZLPhotoBrowser version: e.g. 4.5.3 Device: e.g. iPhone 11 Pro Max Device version: e.g. iOS 17.2.1 Xcode version: e.g. Xcode 15.3
ZLPhotoConfiguration
/// - Parameter type: 0:视频 1:照片 func selectImage(type:Int){ let ps = ZLPhotoPreviewSheet() let psConfig = ZLPhotoConfiguration.default() if type == 0{ psConfig.maxSelectVideoDuration(120) psConfig.minSelectVideoDuration(3) psConfig.allowSelectVideo = true psConfig.allowSelectImage = false psConfig.maxSelectCount(1) psConfig.allowEditVideo = true }else{ psConfig.allowSelectImage = true psConfig.allowSelectVideo = false psConfig.maxSelectCount(9) } }
这么写是为了避免self和timer之间的循环引用。有崩溃的堆栈吗?
我找了个iPhone15Pro 17.4.1的系统试了下,没有遇到crash,应该不是必现,或者跟机型有关
Issue Description
Description and Steps
ZLEditVideoViewController.m第408行,为啥要这么写
timer = Timer.scheduledTimer(timeInterval: duration, target: ZLWeakProxy(target: self), selector: #selector(playPartVideo), userInfo: nil, repeats: true)
,我这边跑起来会崩溃,改成这样就没问题:timer = Timer.scheduledTimer(timeInterval: duration, target: ZLWeakProxy(target: self).target, selector: #selector(playPartVideo), userInfo: nil, repeats: true)
Info
ZLPhotoBrowser version: e.g. 4.5.3 Device: e.g. iPhone 11 Pro Max Device version: e.g. iOS 17.2.1 Xcode version: e.g. Xcode 15.3
Configuration code of
ZLPhotoConfiguration