Swift ERROR- [__NSCFData gotoShowChannel11] When i create button in Delegate and add view on tabbar -
i gating problem in ios 8 code working in ios 9 . have create 1 transparent button , add subview in tabbar method. problem button event not working when tabar load second time , problem in ios 8 , working in iso 9. here code
delegate
var button_oftabbar = uibutton(); //var button_oftabbar:uibutton!; //uibutton();= uibutton(type: uibuttontype.system)
in tabbar
class tabbar: uitabbarcontroller,uitabbarcontrollerdelegate { //let button_oftabbar = uibutton(); var delegate1: appdelegate! let adatabase : databaseinit = databaseinit() override func viewdidload() { super.viewdidload() uitabbar.appearance().tintcolor = uicolor(red: 242/255.0, green: 134/255.0, blue: 55/255.0, alpha: 1.0) self.delegate=self; delegate1 = uiapplication.sharedapplication().delegate as! appdelegate uitabbar.appearance().bartintcolor = uicolor.whitecolor() if(delegate1.tag_jive_channel_tab == 0) { // delegate1.button_oftabbar.removefromsuperview(); // delegate1.button_oftabbar.settitlecolor(uicolor.blackcolor(), forstate: uicontrolstate.normal) delegate1.button_oftabbar.hidden = false; let widthofbtn:cgfloat = self.tabbar.frame.size.width/5; delegate1.button_oftabbar.frame = cgrectmake(0, self.tabbar.frame.origin.y, widthofbtn, self.tabbar.frame.size.height) delegate1.button_oftabbar.backgroundcolor = uicolor.redcolor()//clearcolor() //delegate1.button_oftabbar = uibutton(type: uibuttontype.system) delegate1.button_oftabbar.tintcolor = uicolor.redcolor()//clearcolor() delegate1.button_oftabbar.addtarget(self, action: "gotoshowchannel11", forcontrolevents: uicontrolevents.touchupinside) self.view.addsubview(delegate1.button_oftabbar); } } override func viewdidappear(animated: bool) { } func gotoshowchannel11() { delegate1.button_oftabbar.hidden = true; //orangecolor tabbar //self.tabbarcontroller?.tabbar.tintcolor = uicolor.redcolor(); delegate1.tag_jive_channel_tab = 1; nsnotificationcenter.defaultcenter().postnotificationname("update_tabbar", object: nil, userinfo: nil); //uicolor(red: 146/255.0, green: 146/255.0, blue: 146/255.0, alpha: 1.0) }
when use line delegate1.button_oftabbar = uibutton(type: uibuttontype.system)
button not show custom/system in both
i try func gotoshowchannel11(sender: uibutton!)
please me . stuck in ios 8 problem . , error error- [__nscfdata gotoshowchannel11] please 1 me . have found solution . thankyou .
Comments
Post a Comment