• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 866
  • Last Modified:

UIBarButton Selected by Default?

Hello,

I have a navigation item where users can select a RSS feed. On the iPad they have to hit a button that says "View Feeds" - I would like this button to be open automatically when the application launches. Is there code that can have this button be "on" default?

Thanks so much.
0
Lanmarkian
Asked:
Lanmarkian
  • 4
  • 4
1 Solution
 
Hamidreza VakilianSenior iOS DeveloperCommented:
You should call the touch up event method for the button on viewDidLoad method in the class you defined the button.
0
 
LanmarkianAuthor Commented:
This is my code. I can't seem to figure it out. Can someone help me?

Thanks.

- (void)splitViewController: (UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController
          withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc {
    
    barButtonItem.title = @"TEST";
    NSMutableArray *items = [[toolbar items] mutableCopy];
    [items insertObject:barButtonItem atIndex:0];
    [toolbar setItems:items animated:YES];
    [items release];
    self.popoverController = pc;
    [barButtonItem setEnabled:TRUE];
   
}

Open in new window

0
 
Hamidreza VakilianSenior iOS DeveloperCommented:
Please upload your project somewhere or send it through a mail to me. You can find my email address on my profile.
0
Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

 
LanmarkianAuthor Commented:
Programmer-x,

I just send you an email through your website.
0
 
Hamidreza VakilianSenior iOS DeveloperCommented:
Please send the mail to this address:
Xerxes235@yahoo.com
0
 
LanmarkianAuthor Commented:
Thanks! Sent.
0
 
LanmarkianAuthor Commented:
Let me know if you did or did not receive. Having a weird email issue. Thanks
0
 
Hamidreza VakilianSenior iOS DeveloperCommented:
a quick workaround for this is to add this line:
[barButtonItem.target performSelector:barButtonItem.action withObject:nil afterDelay:1];

at the end of method: - (void)splitViewController: (UISplitViewController*)svc willHideViewController:(UIViewController *)aViewController
          withBarButtonItem:(UIBarButtonItem*)barButtonItem forPopoverController: (UIPopoverController*)pc


in DentalGeekiPadDetailViewController.m
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now