TTViewController and popupViewController method
Asked Answered
N

1

5

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:interfaceOrientation];
  } 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.

Nik answered 26/1, 2010 at 13:15 Comment(1)
Would love to get a response for this. Am facing the same issue.Bromine
O
8

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.

Oneness answered 24/2, 2010 at 9:49 Comment(1)
Note that this is a pretty common problem any time you're using a 3rd-party static library that was written in Objective-C. You can get more info on what these flags do by going to developer.apple.com/mac/library/qa/qa2006/qa1490.html. To quote: "The -ObjC flag causes the linker to load every object file in the library that defines an Objective-C class or category. [...] The -all_load flag forces the linker to load all object files from every archive it sees, even those without Objective-C code."Prawn

© 2022 - 2024 — McMap. All rights reserved.