开发者

TTViewController and popupViewController method

开发者 https://www.devze.com 2022-12-17 23:01 出处:网络
I\'m using a TTLauncherView and for that I declare a view controller as TTViewController, as is in TTCatalog tutorial app. Declare a TTLauncherView var inside that view, add items, and so on.

I'm using a TTLauncherView and for that I declare a view controller as TTViewController, as is in TTCatalog tutorial app. Declare a TTLauncherView var inside that view, add items, and so on.

In my app's main view is a button calling the previous view with the following code:

-(void) switchToButtonOrderingView
{
    ButtonOrderingViewController *ButtonOrderingView=
    [[ButtonOrderingViewController alloc] initWithNibName:@"ButtonOrderingViewController" bundle:nil]; 
    self.ButtonOrderingViewController = ButtonOrderingView; 
    [self.view insertSubview:ButtonOrderingView.view atIndex:10];
}

When I press the button the app brakes up at this method which belongs to TTViewController.m:

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
  UIViewController* popup = [self popupViewController]; //brakes up here
  if (popup) {
    return [popup shouldAutorotateToInterfaceOrientation:inte开发者_StackOverflow中文版rfaceOrientation];
  } else {
    return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
  }
}

and the error goes like that:

[ButtonOrderingViewController popupViewController]: unrecognized selector sent to instance

Checked to see Three20 Class Hierarchy and TTViewController is a UIViewController subclass.

popupViewController is a TTPopViewController (and its subclasses) method! Which I'm not using nor do TTCatalog tutorial app. I'm lost. Any help will be appreciated.

Thanks.


Had the same issue and found the error!

This is what happens when you forget to add -ObjC and/or -all_load to Other Linker Flags according to the Three20 setup instructions. Could be that you added them to the project level, and have an overriding setup at a lower level - that was the case for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号