I have a tabBar initilized in xib file,
question is, I want to deselect the item that I tapped before,
but I can’t,
I tried
self.tabBar.selectedItem = 0;
self.tabBar.selectedItem = nil;
in any place I can, but it just does not work,
how can I deselect a tabBar item after I tapped it?
Thanks a lot!
Heres my solution to your problem below
.h
.m
This should get you started, its pretty much the same code I use in a project of mine so it should work, you will just have to use your own if statments to get that tabbutton selection and deselection…. if this is not what your looking for the
will be enough for you to clear any selected cells in the tabBar.. however you must remember myTabBar is an IBOutlet so you have to hook it up in Interface Builder to the tabbar you have in there, alternately you could do this in code also but it sounds like your working with a .xib file so the above solution should be sweet.
I have not built and run this specific code so there might be an error in it, let me know if you need any more help.
Anyway I hope this works out for you 🙂