Welcome, Guest
Username Password: Remember me

Buttons on top bar
(1 viewing) (1) Guest

TOPIC: Buttons on top bar

Buttons on top bar 1 year, 3 months ago #1

Morning

With the way STV is setup in terms of the buttons being added to the top bar, what is the best way to add in the i or info button so that I can tie it to another Xib file?

Iain
  • ihmunro
  • OFFLINE
  • Expert Boarder
  • Posts: 135
  • Karma: 0

Re: Buttons on top bar 1 year, 3 months ago #2

Hi Iain,

Are you referring here to this post: www.sensiblecocoa.com/forum/sensible-tab...showing-up.html#1739 ?
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: Buttons on top bar 1 year, 3 months ago #3

Hi Tarek

It may be similar, but no. This was to do with adding in a settings button.

What I wanted to be able to do was add in the Information of i button.

Perhaps I need to do the same thing - not sure.

Iain
  • ihmunro
  • OFFLINE
  • Expert Boarder
  • Posts: 135
  • Karma: 0

Re: Buttons on top bar 1 year, 3 months ago #4

Assuming that you need to add the info button to an automatically generated detail view:

 
- (void)tableViewModel:(SCTableViewModel *)tableViewModel
detailViewWillAppearForRowAtIndexPath:(NSIndexPath *)indexPath
withDetailTableViewModel:(SCTableViewModel *)detailTableViewModel
{
UIButton *infoButton = [UIButton buttonWithType:UIButtonTypeInfoLight];
...
UIBarButtonItem *barButton = [[UIBarButtonItem alloc] initWithCustomView:infoButton];
detailTableViewModel.viewController.navigationItem.rightBarButtonItem = barButton;
[barButton release];
}
 
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72

Re: Buttons on top bar 1 year, 3 months ago #5

Hi Tarek

Thanks - becuase of the -void, I am assuming this goes on its own in the rootviewcontroller.

Which I did - I got a few errors - I took out the ... and then got one error which was a redefinition error.

error: redefinition of '-[RootViewController tableViewModel:detailViewWillAppearForRowAtIndexPath:withDetailTableViewModel:]'


Any ideas ?

Iain
  • ihmunro
  • OFFLINE
  • Expert Boarder
  • Posts: 135
  • Karma: 0

Re: Buttons on top bar 1 year, 3 months ago #6

This means that you already have this method defined in your view controller. Just add my code inside your existing method.
  • tarekskr
  • OFFLINE
  • Administrator
  • Posts: 2402
  • Karma: 72
Time to create page: 0.94 seconds