Setting View to Landscape and Hiding Status Bar in iPhone

February 5th, 2010

If you were wondering how to start your application in landscape mode with the status bar hidden, you need to override two methods in your ViewController: viewDidLoad and shouldAutorotateToInterfaceOrientation.


// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[[UIApplication sharedApplication] setStatusBarHidden:YES animated:NO];
[super viewDidLoad];
}

// Override to allow orientations other than the default portrait orientation.
- (BOOL) shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation) interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationLandscapeRight);
}

Interface Builder does not have “Class Outlets” any longer

January 28th, 2010

I am not sure what happened, but Class Actions and Outlets got moved to a new location. They live now in the Library Window. To add Actions and Outlets to your class, first locate it in the Library (search for it), click and then select Outlets or Actions tabs.

xcode

Creating gradient background for iPhone Tab Bar

January 24th, 2010

If you want to have a gradient on the background of your UITabBar in iPhone 3.0, it’s fairly easy.

Step 1: Create an image with width of 1px and height of 49px with a gradient of your choice. Save the image as png with the name of your choice (tabbar_back_.png).

Step 2: Add the image to your project.

Step 3: Extend UITabBarController. Assuming you already have Tab Bar Controller in your xib file, go to Xcode and create a new UIViewController subclass with the name of your choice (MyUITabController).
Change the header file to:
@interface MyUITabController : UITabBarController{}@end
Change the implementation file to:

- (void)viewDidLoad {
[super viewDidLoad];
CGRect frame = CGRectMake(0, 0, 480, 49);
UIView *viewWithColor = [[UIView alloc] initWithFrame:frame];
UIImage *backgroundImage = [UIImage imageNamed:@"tabbar_back_.png"];
UIColor *backgroundColor = [[UIColor alloc] initWithPatternImage:backgroundImage];
viewWithColor.backgroundColor =backgroundColor;
[backgroundColor release];
[[self tabBar] insertSubview:viewWithColor atIndex:0];
[viewWithColor release];

}

Save the project.

Step 4. Go to Interface Builder and select UITabBarController. Press Command+4 this should bring up Controller Identity Window. Select your new file name (MyUITabController) from Class Identity Class drop down. Save. Build and go!!!!!

Configuring Subeclipse with Flex 3

January 22nd, 2010

I have two computers one of which runs SVN. When I tried to access the SVN from a remote Flex Builder, it worked fine. Subeclipse on a local Flex Builder however was not able to connect and was giving me this error: error validating location.
The trick is to use local host to connect locally to the SVN with Subeclipse. In the url enter next – (protocol of your choice)://localhost/path_to_your_repository

No Flash CS5 Beta

December 19th, 2009

Adobe decided to cancel Flash CS5 Beta. I wonder if it has something to do with Apple (being control freaks) freaking out about Flash CS5 being able to compile applications for iPhone.

SVG is alive and well

December 13th, 2009

I have been working on a countdown timer for the 2010 New Years (work in progress) and decided to give SVG a try. And it works great in most browsers except IE of course. To work around this annoying limitation, I downloaded SVGWEB javascript library. This is an amazing library that detects IE and substitutes SVG with Flash.
Working with SVG is very easy since it becomes a part of your document DOM model. You can manipulate it with common used DOM methods: getElementById, getElementsByTagName and others.

My Portfolio Beta is Up

November 11th, 2009

here it is H E R E

Narita’s butterfly effect

March 23rd, 2009

Our United flight from Bangkok to Narita got cancelled. We wouldn’t have known about it, had Jon not checked our voicemail. United rescheduled us on a flight from Bangkok to Seoul and from Seoul to San Fran. The worse part was that the flight from Bangkok to Seoul was leaving at 1.20am arriving to Seoul at 8.30am and our flight to SF was not until 2.00pm. So now we are in Seoul waiting for our flight to SF.
Needless to say that our original flight to Narita from Bangkok was not cancelled and actually left Bangkok with a 2 hour delay. Thanks United!!!

Le Meridian Resort Beach

March 22nd, 2009

This resort has one of the best beaches I have ever been too. Here is a few pictures.

Le Meridian Phuket Resort

March 20th, 2009

So the weather has been on and off.. We were supposed to take a speed boat to Phi Phi Islands, but the trip got pushed to tomorrow due to weather. Here is a few pictures of our resort I took yesterday.