0
當我收到說線程1的錯誤:EXC_BAD_INSTRUCTION(代碼= EXC_1386_INVOP,子碼=爲0x0)當我試圖聲明EXC_BAD_INSTRUCTION聲明button.frame
var buttonFrame = customButton.frame
這裏是我的代碼。任何幫助表示讚賞。
override func viewDidLoad() {
super.viewDidLoad()
//sends menuOverlay to back on load
parentView.sendSubviewToBack(menuOverlay)
self.menuOverlay.hidden = true
//sends sliderContainer back and makes its origin at the button
let containerFrame = sliderContainer.frame
let containerFrameX = containerFrame.minX
let containerFrameY = containerFrame.minY
var buttonFrame = customButtonOne.frame
let sliderOriginX = buttonFrame.minX + (buttonFrame.width/2)
let containerTranslationX = CGFloat(containerFrameX-sliderOriginX)
let containerTranslationY = CGFloat(-containerFrameY)
self.sliderContainer.transform = CGAffineTransformMakeScale(0.001, 0.001)
self.sliderContainer.transform = CGAffineTransformMakeTranslation(containerTranslationX, containerTranslationY)
}
'customButtonOne'的定義是什麼? – Alexander