PDA

View Full Version : Installing the updated iPhone SDK won't let me declare UIToolbarController




Spike099
Mar 27, 2008, 11:35 PM
What was once working code, is now not compiling. In my interface file I have a simple declaration as follows:

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

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?



rendezvouscp
Mar 27, 2008, 11:42 PM
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. :)

Spike099
Mar 28, 2008, 06:10 AM
Ohh! Thanks as usual kainjow.

AlwaysLearning
Mar 28, 2008, 06:51 AM
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?

Sbrocket
Mar 28, 2008, 08:50 AM
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.

Sayer
Mar 28, 2008, 03:24 PM
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.

NetMage
Mar 29, 2008, 01:27 AM
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.


Just replace toolbarItem with tabBarItem in UIViewController and it works.