ios - tableview doesn't work properly in iPhone 6 simulator -
i have tableview gets data , shows them list. when run code on iphone 5 simulator, works fine. when test on iphone 6 simulator, 2 first cells have no functionality. form third cell, works fine too. i'm new on swift programming , have no idea why happens. here screenshot of app:
when plus or minus sign or add order, they're not working. after two, third item, works correctly.
here's code:
class drinkdetailcell : uitableviewcell { @iboutlet var title: uilabel! @iboutlet var price: uilabel! @iboutlet var image2: uiimageview! @iboutlet var addbasket: uibutton! var order = orderdrink() @ibaction func addtobasket(sender: anyobject) { order.count = string( amounth ) orderdrinktable().add(order) nsnotificationcenter.defaultcenter().postnotificationname( "reloadprice", object: nil) hud.flash(.success, delay: 1.0) } var amounth = 1 @ibaction func mines(sender: anyobject) { if( amounth > 1 ) { amounth -= 1 quantity.text = string( amounth ) } } @ibaction func plus(sender: anyobject) { amounth += 1 quantity.text = string( amounth ) } @iboutlet var quantity: uilabel! @iboutlet var quantity1: uilabel! override init(style: uitableviewcellstyle, reuseidentifier: string? ) { super.init(style: style , reuseidentifier: reuseidentifier) } required init?(coder adecoder: nscoder) { super.init(coder: adecoder) self.backgroundcolor = uicolor.clearcolor() } }
Comments
Post a Comment