Removing Info Bar in iPhone Interface - iphone

How do you get rid of the info bar displaying the battery, time, carrier, etc when running my app? Is it something I have to do using Objective-C, or is there an option within Interface Builder?

Go to your project info and add the key value:
Status bar initialy hidden. Set this on YES.
Or add this code to your app delegate:
[[UIApplication sharedApplication] setStatusBarHidden:YES];

There is a way to turn it off in both Interface Builder and in code. It's usually referred to as the "status bar" in Apple's documentation.

Related

UITabBarController Like Apple's Remote App

Does anyone have an idea how Apple implemented the UITabBarController in the iOS Remote App (for controlling iTunes)?
Specifically, how the Remote will show a blacked out Tab Bar until the user selects an iTunes library (in a modal view), after which the tabs show "Songs," "Artists," etc.
Where would they have placed the logic to check that an iTunes library is selected and how do they blackout the tabs until it is?
Thanks
You basically can set the UITabBarItem's enabled property to false.
Like:
[tabBarItem setEnabled: NO]; // to disable

Buttons make my multiview iphone app crash! (but single view is okay)

This is probably some rookie mistake, but I can't figure it out. I've established a button within my app to recall a link in safari. From my method file it looks like this:
Obj C Code:
-(IBAction)linkSafari{
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:#"http://en.wikipedia.org/"]];
}
I linked it up in IB and all seems okay.
When I create this same setup as a single view app it works great, but whenever I click it in my multiview app it's an automatic crash. Acts the same way on both my simulator and physical ipod.
Is there an endless list of places I could have screwed up or is there a certain area I should look into?
I don't think the problem is in that particular function,
but on the way you create the views and viewcontrollers
For anyone interested, this was solved thanks to an extra set of eyes. On my tab bar, I'd declared the assigned nibs for every section, but missed a few class associations. That's what messed me up.

How to get a reference to the current window?

Need a ref to the window in which a view is inside (no matter how deep inside). Usually there is only one window in an iPhone app. How would I access that the most easy way? Is there something cooler than getting the app delegate to access the window?
To get a currently used window by your application use:
[[UIApplication sharedApplication] keyWindow]
Well, UIView has the window property...

How to terminate an iPhone application through a TabBaritem in Interface Builder?

I have developed an iPhone app where there are four tab bar items and if i press the last TabBar the application should terminate. How to do it in Interface Builder?
Terminating the app must involve code. It can’t be done simply in IB. And there’s no documented and clean way to quit the app besides exit(0), see one of the previous questions on this topic.
In the action you can write "[[UIApplication sharedApplication] terminateWithSuccess];"
And in the head file you add
"#interface UIApplication (extended)
-(void) terminateWithSuccess;
#end"
No vagaries.
Never ever quit the app programmatically.

How do I turn the status bar off?

New view based project in XCode
Go to main.xib and view.xib respectively
In each case set status bar to none in attributes section for view
Not sure why it still shows both on simulator and on platform?
Have looked for something in code, but don't see what else is calling this?
Anybody know how to turn the status bar off?
Thanks // :)
Figured it out...
Using Snow Leopard and the XCode 3.2, you simply edit the Apps Info.plist.
Right click the open Info.plist and add a row.
Select "Status Bar Style" from the drop down list. In the column to the right type in UIStatusBarHidden.
To affect this more dynamically this can be used instead:
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO]; should hide the status bar.
// :)
The status bar off in interface builder does not make it go away, use UIApplications - (void)setStatusBarHidden:(BOOL)hidden animated:(BOOL)animated here http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIApplication_Class/Reference/Reference.html#//apple_ref/occ/instm/UIApplication/setStatusBarHidden:animated: