Installing the updated iPhone SDK won't let me declare UIToolbarController

Discussion in 'Mac Programming' started by Spike099, Mar 27, 2008.

  1. macrumors regular

    Joined:
    Feb 18, 2007
    Location:
    Canada
    #1
    What was once working code, is now not compiling. In my interface file I have a simple declaration as follows:

    Code:
    UIToolbarController *toolbarController;
    That come up as an error "syntax error before 'UIToolbarController'"

    When I remove that declaration, the error goes away... However I needed that toolbar. If I declare the tool bar in my loadView method like so

    Code:
    UIToolbarController *toolbarController = [[UIToolbarController alloc] init];
    The following errors appear.

    'UIToolbarController' undeclared (first use in this function)
    'toolbarController' undeclared (first use in this function)

    Something else that broke. I have a navigation bar with it's style set to UIBarStyleRed. But the following error comes up now.

    error: 'UIBarStyleRed' undeclared

    The other styles work fine. Although I like the black style better now. :)

    Anyone else experiencing issues?
     
  2. macrumors 68000

    Joined:
    Aug 20, 2003
    Location:
    Long Beach, California
    #2
    UIToolbarController is now UITabBarController, so you'll need to update your files respectively. I found this out by checking out the Beta 1 to Beta 2 API list of changes that kainjow mentioned. If you have any more issues like this, that's the best place to check first. :)
     
  3. thread starter macrumors regular

    Joined:
    Feb 18, 2007
    Location:
    Canada
    #3
    Ohh! Thanks as usual kainjow.
     
  4. macrumors newbie

    Joined:
    Mar 28, 2008
    #4
    This change even breaks one of the XCode startup projects: the Toolbar project just won't compile. It also doesn't seem like it is just changing the names around, UIViewController doesn't offer access to the new TabBarItem the way it did the ToolbarItem.
    Maybe this is all designed to make it play nice with the InterfaceBuilder style of doing things, but so far I haven't figured out how to make it do the things I had working before in code, like attaching NavViewControllers to a TabBarController. This whole update feels pretty rushed out given the way that it breaks stuff and doesn't seem to try very hard to explain either the changes or how to use the new tools. When is the documentation going to get an update to match?
     
  5. macrumors 65816

    Sbrocket

    Joined:
    Jun 3, 2007
    Location:
    /dev/null
    #5
    Beta SDKs do that to you, AlwaysLearning. Expect things to not work when you updated to the latest beta - its the rule, not the exception.
     
  6. macrumors 6502a

    Sayer

    Joined:
    Jan 4, 2002
    Location:
    Austin, TX
    #6
    There is a ton of documentation and resources available right from Apple and listed in the new Xcode "Welcome" window.

    A lot of this stuff is covered in the docs or the headers/frameworks in the SDK itself.
     
  7. macrumors newbie

    Joined:
    Oct 21, 2007
    #7
    Just replace toolbarItem with tabBarItem in UIViewController and it works.
     

Share This Page