Archive for category Apple

Quick Tip: Fix clear button for Calculator

I upgraded to Mac OS X Lion last month and there has been quite a few changes to get used to. One thing I noticed was that my clear key on the full keyboard doesn’t work anymore in the Calculator widget. After a little searching, I found a solution!

1. Open up a finder window and navigate to the following folder:

/Library/Widgets

2. Next locate Calculator.wdgt and ctrl-click on it, then select “Show Package Contents.”
3. Copy Calculator.js to some other location such as your desktop.
4. Open the file up in any text editor.
5. Goto line 127, and change “case 63289? to “case 61705?. It should look like this when you are done.

case 61705:
case 27:
	key = "c";
	break;

6. Close and save the file.
7. Copy the file back to the contents of Calculator.wdgt.
8. Fire up dashboard and remove your current calculator widget and add a new one.

You’re clear button will now work in Calculator!

Here is the link to the original solution.

Quick Tip: Show Library Folder in Lion

I use my user library folder all the time, and I’m a little bit annoyed that the Library folder is now hidden in Mac OS X Lion. Here is how I changed that!

Open up Terminal and type the following and tap return:

chflags nohidden /users/<insert your username here>/Library

Note: Make sure you substitute your username in that command.

Hide the TabBar in an iOS App

I recently came across a situation where it was useful to have a UITabBar based application, however the actual tab bar was an unnecessary item on the screen. This post is a mini tutorial on how to make this happen.

UPDATE: A few people have asked for the source code, so here is the project.

Inside “application:didFinishLaunchingWithOptions:” method:

 tabBarController = [[UITabBarController alloc] init]; tabBarController.viewControllers = [NSArray arrayWithObjects:navController1, viewController1, viewController2, nil]; [window addSubview:tabBarController.view]; [self makeTabBarHidden:TRUE]; 

 

 

Here is the “makeTabBarHidden” method:

 -(void)makeTabBarHidden:(BOOL)hide { // Custom code to hide TabBar if ( [tabBarController.view.subviews count] &lt; 2 ) { return; } UIView *contentView; if ( [[tabBarController.view.subviews objectAtIndex:0] isKindOfClass:[UITabBar class]] ) { contentView = [tabBarController.view.subviews objectAtIndex:1]; } else { contentView = [tabBarController.view.subviews objectAtIndex:0]; } if (hide) { contentView.frame = tabBarController.view.bounds; } else { contentView.frame = CGRectMake(tabBarController.view.bounds.origin.x, tabBarController.view.bounds.origin.y, tabBarController.view.bounds.size.width, tabBarController.view.bounds.size.height - tabBarController.tabBar.frame.size.height); } tabBarController.tabBar.hidden = hide; } 

 

 

And you are probably wondering how to change the views that are normally controlled by the tab bar? Here is the answer…just simply change the selectedIndex property of the tab bar.

 tabBarController.selectedIndex = 1; 

The complete source code for the project.

Part of this code came from a post I found on iPhoneDevSDK.com, so I took it one step further and made it a complete solution.

iPhone 4

Some pictures from the iPhone 4 release event in Shadyside, PA.


iPhone 4 End of line at Shadyside
iPhone 4 About to go in to the Apple Store

iPhone Line outside Shadyside PA Apple Store

Character Symbol

Apple Symbol
This little post is only for Mac users. Open up a text editor and type “shift-option-k”.

iPod Project

iPod NanoOn a recent visit to my parent’s house, I was speaking with my brother who received an iPod nano for Christmas about 2 years ago. He was telling me about his new iPod video when my curiosity got the best of me and asked him about the nano. He said the screen was busted so he got the new one. I looked at it and decided that I could replace the screen easily and asked him if I could have the busted nano. He obliged and gave me the nano. I ordered the screen off of ebay for $18.85 USD to include shipping, and replaced the screen. If you would like a video of what I did to take the iPod nano apart click here to watch it. The video is provided by the online show Systm. Below is some pictures I told of the dismantled iPod nano and the new screen.

iPod Nano Repair iPod Nano Repair