Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Spike099

macrumors regular
Original poster
Feb 18, 2007
143
0
Canada
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?
 

rendezvouscp

macrumors 68000
Aug 20, 2003
1,526
0
Long Beach, California
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. :)
 

AlwaysLearning

macrumors newbie
Mar 28, 2008
1
0
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

macrumors 65816
Jun 3, 2007
1,250
0
/dev/null
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

macrumors 6502a
Jan 4, 2002
981
0
Austin, TX
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

macrumors 6502
Oct 21, 2007
255
226
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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.