0

So in my app a user can receive messages. I use awakeFromNib to update the badge value(which represents number of unread messages) of a tab bar item as soon as the tab bar controller loads (for a different tab bar item then the initial view) and then when I click on the view controller with the tab bar item that has the badge value, I make the badge value disappear. However, I want the badge value to reappear every time the user gets a new message. I have pull to refresh enabled but for some reason the badge value never reappears unless I restart the app or revisit the tab bar controller itself (I have to log out then log back in to do that in my app). Any solutions?

Edit: The class with the tab bar item that has the badge value is a subclass of UITableViewController if that makes a difference...

shreyashirday
  • 892
  • 1
  • 10
  • 34
  • check: http://stackoverflow.com/questions/6446493/uikit-call-awakefromnib-programmatically – Nitin Gohel Jul 11 '14 at 13:39
  • 5
    Yes, `awakeFromNib:` is only called once. – duci9y Jul 11 '14 at 13:41
  • it called only once when you instantiate the class from `nib`, otherwise not; you can find more info about it under the `NSNibAwaking` Protocol Reference: https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/Protocols/NSNibAwaking_Protocol/Reference/Reference.html – holex Jul 11 '14 at 13:45
  • please see the Edit: I don't think initWithFrame is possible in this case, right? – shreyashirday Jul 11 '14 at 15:45

0 Answers0