Reputation: 462
The layout...
I have a UIToolbar that loads a view with several buttons. One of those buttons, on the onpress should display a popup.
It does. However, the popup seems to open up at 0,0.
-(IBAction)FilterButtonPressed:(id)sender
{
if (_FilterViewController == nil) {
self.FilterViewController = [[[FilterViewController alloc] initWithStyle:UITableViewStylePlain] autorelease];
_FilterViewController.filterViewDelegate = self;
self.FilterViewPopover = [[UIPopoverController alloc] initWithContentViewController:_FilterViewController];
}
NSLog(@"Button...: %@",NSStringFromCGRect(self.FilterButton.frame));
[self.FilterViewPopover presentPopoverFromRect:self.FilterButton.frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
The NSLog reads:
Button...: {{0, -4.38184}, {0, 4.76182e-39}}
which is... just weird..
Any suggestions as to why the FilterButton doesn't know where it is?
Upvotes: 0
Views: 368
Reputation: 19323
Any suggestions as to why the FilterButton doesn't know where it is?
Looks like it's uninitialized / not properly initialized. Are all your outlets set up properly? Whenever "my xyz object is not behaving properly" happens, checking your outlets is usually the first order of business (note that the action can be hooked up from a button, but your link to the button from your class may not be. Try printing the state from the "sender" cast to "UIButton *".
Upvotes: 2