Building a simple iPhone TabBarController application – Part 1

I’ve been asked a few times how to create a tabbed iphone application with a lobby like feel like the Facebook iPhone app. Well here is a walk through that will hopefully get you started in your application creation.

First step, Open Xcode

Next Select File| New project | Window Based Application

A window will pop up asking for a name of the project. Lets name the project LobbyTest. This will create a basic iPhone application containing the following objects:

CoreData.framework

CoreGraphics.framework

Foundation.framework

UIKit.framework

Lobbytest-info.plist

LobbyTest.app

LobbyTest.xcdatamodel

LobbyTest_prefix.pch

LobbyTestAppDelegate.h

LobbyTestAppDelegate.m

Main.m

MainWindow.xib

Lobby Test First Screen

Now press the Build and Go button at the top of the screen (hint look for the green button with the hammer) You should see the following blank application.

Blank Application that looks like a flash lite

Horray! You have just created a simple iPhone app called Flashlite. Yes I’m serious, someone actually took this simple app and put it in the App Store.  See how easy this is J. Ok, so you want to do a little more? Let continue.

Open the Classes folder and double click on the LobbyTestAppDelegate.h file. You should see the following code:

//

//  LobbyTestAppDelegate.h

//  LobbyTest

//

//  Created by your name on XX/XX/09.

//  Copyright __MyCompanyName__ 2009. All rights reserved.

//

@interface LobbyTestAppDelegate : NSObject <UIApplicationDelegate> {

NSManagedObjectModel *managedObjectModel;

NSManagedObjectContext *managedObjectContext;

NSPersistentStoreCoordinator *persistentStoreCoordinator;

UIWindow *window;

}

@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel;

@property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext;

@property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;

@property (nonatomic, retain) IBOutlet UIWindow *window;

- (NSString *)applicationDocumentsDirectory;

@end

You will now need to add the TabBarController to this code. This will allow you to have Tabs on the bottom of your main lobby page for navigation. The variable to be added under the *window variable is UITabBarController *tabbarController;

We will also need to add an outlet to the Delegate so we can add our new tabbarController to the main window. This outlet is defined under the *window outlet as the following:

@property (nonatomic, retain) IBOutlet UITabBarController *tabbarController;

We will build the actual controller shortly. Here is the code now for the LobbyTestAppDelegate.h file.

@interface LobbyTestAppDelegate : NSObject <UIApplicationDelegate> {

NSManagedObjectModel *managedObjectModel;

NSManagedObjectContext *managedObjectContext;

NSPersistentStoreCoordinator *persistentStoreCoordinator;

UIWindow *window;

UITabBarController *tabbarController;

}

@property (nonatomic, retain, readonly) NSManagedObjectModel *managedObjectModel;

@property (nonatomic, retain, readonly) NSManagedObjectContext *managedObjectContext;

@property (nonatomic, retain, readonly) NSPersistentStoreCoordinator *persistentStoreCoordinator;

@property (nonatomic, retain) IBOutlet UIWindow *window;

@property (nonatomic, retain) IBOutlet UITabBarController *tabbarController;

- (NSString *)applicationDocumentsDirectory;

@end

Ok, now lets update the LobbyTestAppDelegate.m file.  What we want to do is load the tabbarcontroller after the MainWindow.xib has finished loading.  First we need to add our variable to the synthesized variables of our object.

@synthesize window, tabbarController;

We then look for a method called applicationDidFinishLaunching.

- (void)applicationDidFinishLaunching:(UIApplication *)application {

// Override point for customization after app launch

[window makeKeyAndVisible];

}

We need to modify this code to include a sleep timer and our new tabbarcontroller object. The sleep timer will be used to display a splash screen before showing our new tabbarcontroller.

- (void)applicationDidFinishLaunching:(UIApplication *)application {

//Sleep for splash screen

sleep(2);

NSLog(@”Creating tabBarController…..”);

[window addSubview:[tabbarController view]];

// Override point for customization after app launch

[window makeKeyAndVisible];

}

Now, select the Resources folder and double click the MainWindow.xib. This will open the Interface builder application. This is the application we use to make the visual changes to our application using a GUI interface. It is kind of strange to get used to making code changes in XCode then switching to Interface Builder for visual changes. However you will get used to doing it, trust me.

You should see an interface that looks similar to this.

This looks like fun doesn't it?

In the above image I have already added the tab bar controller so don’t be alarmed if you don’t see it on yours. You will add it now by opening the Library, selecting the Controllers folder, and selecting the Tab Bar Controller object. Drag the object under the Window object in the MainWindow.xib window.

Now lets look at the Inspector tool and select the Application Connections tab. We will then select the File’s Owner object in the MainWindow.xib window. We will need to map a new reference object to the LobbyTest App Delegate. We do this by selecting the little circle next to the New Referencing Object text in the Inspector tool and dragging it to the delegate object in the MainWindow.xib.

Next we will create a connection between the LobbyTest App Delegate and our new tabbarcontroller object variable. First select the LobbyTest App Delegate under the MainWindow.xib window. Now if we look at the Inspector window we should see two Oulets and one Referencing Outlet listed. We will now need to select the little circle next to the tabbarController outlet and drag it over to the new Tab bar Controller that we placed under our Window object earlier.

Your windows should now look like mine above. Select File | Save. Switch back to the XCode window and select Build and Go. You should see an interface similar to this.

Ok, now that we have our two tabs displaying, we will need to add our view windows and fancy it up a bit with custom buttons and a cool splash screen. We will talk about this in our next article.

Struggling with Clearwire Static IP

Well my struggles with Clearwire and the use of their static ip continue. I paid for the static IP in order for me to host a single IP camera from my house. The IP camera I chose to use in my simple system is the TV-IP110W.

IP110W by Trendnet

Simple IP camera with built in web server by TRENDnet

I chose this camera since  it was relatively inexpensive. (Roughly $100 at Amazon) When I was with AT&T DSL, I was able to set up the camera relatively easily. I basically opened up a port in my router to the web server port on the camera, point my static IP address to my router and was online in a flash. So simple.

Well, silly me thought that I could do the same thing with Clearwire. So I ordered the static IP address. yes I did say “ordered” since you have to pay extra ($10 a month) for the static IP instead of getting one for free like AT&T. :( Since my router was already setup from my AT&T configuration, I thought I was set. Well, I was wrong…..so wrong.

Clearwire does the strangest thing. You have to map your static IP to their modem instead of your router. Why you must do this is crazy to me. I talked to the technical (non) support goons and never got a “clear” answer. So i said whatever, and pointed my paid for static IP to the modem MAC address. Does that work? NO. I call the goons again and unfortunately their tech support script does not provide an answer. So I get the run around and never get an answer.

Another thing to mention is that Clearwire’s modem comes with it’s own DHCP server! So your router will get this dynamic IP instead of the Static IP that you paid for!! And guess what, the goons don’t know the password to your modem so you can’t change the IP address either!. Uggggghhh!! What that means is that you are so screwed my friend. Well, not yet because your good buddy Joe (uh…thats me) has figured out something that most good hackers already know. When trying to figure out a password, start with common names/phrases that are related to what you are trying to hack. So I tried the a bunch of generic common passwords and cracked the code baby!! The password for Clearwire modem i have is motorola. Trust me, this is your password too. :)

Ok, now that I’ve hacked in, where do we go from here? Well i am in the process of figuring that out. The modem has a series of menus in it’s interface similar to my router. I will tinker with this and let you know what happens.

So have you been able to host your camera or server using a Clearwire modem?

Google Wave Hello or GoodBye

After a long wait, I was finally accepted into the Google Wave trial recently. I wasn’t sure what to expect  since I did not know  what Google Wave was. Some of my techie friends said is was created by Google to replace Facebook as the top social site so I figured I’d better check it out.

I applied and was accepted into the Google Wave trial (or preview) stage. In this stage we are allowed to view some demo Extensions and even create Extensions of our own.  Extensions or Gadgets are custom programs you can write to be used in the interactions you have with your contacts.

Here is a screenshot of the Google Wave interface:

google wave interface

This is the look and feel of Google Wave

So far I haven’t been too impressed with Google Wave. However a lot of my doubt has been centered around that fact that I just don’t know what it is.  It is billed as an online tool for collaboration and communication in real time. So I guess you can call it a Facebook by Google? I plan to develop a simple application using the Gadgets API so I will find out more. What do you think? Will Google Wave replace Facebook or Linked In as the real time collaboration tool of choice?

Black Friday Sales Web Site List

Here is a list of sales sites for Black Friday:

http://www.blackfriday.info/

http://blackfriday.gottadeal.com

http://www.fatwallet.com/black-friday

http://dealnews.com/black-friday.html?iref=dnhd

http://www.Target.com/BlackFriday

http://bfads.net

http://www.black-friday.net

http://www.theblackfriday.com

http://www.dealtaker.com/blackfriday.html

I’ve realized that while black Friday is good for getting Christmas shopping done early, it is also an opportunity for retails to take advantage of the non savvy consumer. Here are a couple of things to watch out for:

  1. Look out for limited quantity deals – You’ve seen the ads for that great TV deal…52′ LCD flat panel TV for $400. Oh ..but did you see the fine print…”Quantity limited to 2…no rainchecks..first come first serve..first born son requested..” Ok…maybe the last one is exaggerated (slightly) but that’s how they get you. So you wait in line at the door and rush in the store only to find out that you missed the deal. Oh well….might as well buy some of the higher priced stuff while your there huh?? The retailer is now smiling all the way to your bank! Don’t fall for it! If the quantity is limited to less than 50 don’t go because you most likely won’t get it.
  2. If it is out of stock, don’t buy it – Well, not if you need it by Christmas anyway. Yeah you would think that 20 days is enough for the retailer to restock but I’ve heard too many horror stories about people waiting MONTHS for back ordered Christmas gifts.
  3. Don’t be fooled by the word SALE - Start checking prices now for your gifts. Just because they claim it’s a Black Friday deal, doesn’t mean it’s to lowest price of the season.
  4. Bring a posse that doesn’t include your young kids – Bringing infants and toddlers to a Black Friday sale is just not a smart plan. Especially if you plan to get to the store before opening and wait in line with the other insane people.  Don’t believe me, watch the video below. Not pretty.
  5. Check online for deals first - Why wait in the cold when the same item is online? Especially if it can be picked up at the store the same day like some retailers are doing.

Anyway I hope these tips are helpful. Have a safe, pleasant and blessed shopping experience on Black Friday!

Starting P90X

So I have convinced my wife that we need to get back in shape. Our two kids are finally to the point where they are in bed by 8pm so we will start working out between 8:30 and 9:30. Right now I’m researching the best program for us to do together and I came across the P90X program by Beachbody. So what do you think?

Microsoft PDC – Day 4

Today was the last day of PDC09. Unfortunately I didn’t get to see any of the sessions today since our team had some support issues to deal with. However I did get a chance to work on a Windows Azure hands on lab which helped me experience the excitement of Windows Azure. The lab contained multiple tasks which entailed me connecting to Windows Azure through a Visual Studio 2010 project. The lab was pretty straight forward since they provide the code for you so it was more of an exercise of typing accuracy. I don’t have a review today of Azure but check back in the coming weeks since I definitely will sign up for the free trial.

My rating of the conference is a B-. Since I didn’t attend the previous PDC events nor TechEd, my view is not based on Microsoft history. Instead it is based on my expectations of what a great conference would be. For me that included clear communication of the features of the event, low cost, great networking opportunities, and exceptional value.

The primary negative factor that affected the above rating was the poor manner of communication of what to expect from the conference by Microsoft. I think the PDC website was poorly designed for retrieving information in order to identify what topics I wanted to view.  The topics really weren’t grouped well and the information became available on the site last minute. If Microsoft expects people to pay the hefty price tag for the conference, they really need to let the attendees know exactly what the focus of the conference is and why they should be attending. Also if your hosting a conference on the latest technologies offered, why not use some of those technologies to build your site?? That to me is just mind-boggling.

The primary positive factor that affected the rating above was the swag. I thought they did a good job offering cool free stuff. The best thing of course was the free tablet PC. However if they had filled it with development tools instead of just office tools, I think they would have had a larger impact to the attendees.

Overall, it was a good conference and I look forward providing effective feedback so the next one will be even better.

Microsoft PDC Review – Day 3

Today I finally understood why a lot of the attendees were focused on getting their “swag” from this conference. At first I thought they all had been watching too many Soulja Boy videos. I was so wrong. today Microsoft handed out FREE TABLET LAPTOPS! Yes, you heard me! Ok…ok…it was only a mini one but still! Cool swag right! I have been singing Soulja Boy all day….I get my Swaaaag Onnnn!! :-P

Anyway let me calm down. We got the Aspire 1420P loaded with Windows 7 and Office 2010. I was hoping they would have included Visual Studio but I’m not complaining. Now I can install Visual Studio, and play around with the new Touch features. Here are some photos from the conference:

The conference theme continues to be Windows Azure. The use of Azure is free between Novemeber 17 and December 31st. Microsoft will start charging commercially beginning in February 2010. I plan to sign up for the test period and post a review so check back here in a few weeks.

The sessions I checked out today were:

Developing REST Applications with the Microsoft .NET Framework

Review: i thought Henrik Frystyk Neilsen did a good job with this session. He did a basic overview of what REST is and then built an example on how to develop a basic application. More will come on this since I plan to develop a REST service that will run on Azure.

Coming together in the Cloud

Review: This session was the toughest for me to sit through. The first two presenters were stuggling to communicate and one of them seemed unprepared. However the last presenter did a good job talking about a project they are working on at NASA. It’s called the Pathfinder Innovation project and it allows developers to contribute to MARS exploration code development. You can check out and sign up for information on the project here.

Windows Azure Tables and Deep Dive

Review: Good session. Talked about how to handle redundancy and load balancing in the Azure environment through the use of partitions. More to come on this when I demo Azure.

Here are some video of cool stuff seen at the conference:

I also participated in a focus group today. I’ll wait until after the conference to talk about this since I don’t want to impact their study.

More to come tomorrow. Hopefully with more swag! :)

Microsoft PDC review – Day 2

Ok, yesterday was a good day at the PDC. I checked out the “Getting the Most out of Silverlight 3″ session and saw some of the cool things that can be done with Silverlight. I learn more by doing so I will take the time to download and try the code examples and add an update later.

Today I checked out the following sessions:

Data Programming and Modeling for the Microsoft .NET Developer

Review: This was a great overview of the newest techniques for accessing data. The guys presenting were rather entertaining as well :) The three ways of accessing data discussed were database, entity and class. Instead of using ODBC for accessing data, Microsoft has introduced the OData (Open Data Protocol) for sharing data with  SQL server 2008.  This way of accessing data appears to be a lot simplier and cleaner.

Windows Azure Present and Future

Review: I wasn’t too impressed with the presentation style for this topic, but I did like what I heard about Windows Azure. Azure is Microsoft’s cloud services platform. I plan to do a side by side comparison to Amazon EC2 so look for that in the near future. Anyway, you can use the platform for free until the end of January 2010 so visit their site and take advantage!

Building Sensor and Location-Aware Applications with Windows 7 and Microsoft .NET Framework 4

Review: I liked this presentation because you could tell that the manager presenting loved what he did and thought it was cool.  This discussion was on the GPS toolkit that can be used with Windows 7 for tracking and location capabilities. I’m already thinking of ways I can use it to identify where a client is in order to provide a reference to a partner location in their area. :)

Partner Expo Reception (Who did I like)

TelerikTheir .NET toolbox looks cool and they offered free licenses to test it out for a year. I hope to try it out and review their services in the upcoming months.

Mono – is a portable open source implementation of the .NET framework for operating systems other than Windows. This includes Linux, MacOS and Unix. This allows for programmers who are comfortable in .NET to build applications for any OS. For example, you can build a .NET application for the iPhone using C# instead of objective C. How cool is that!!

More to come, including photos tomorrow..

Microsoft PDC Review – Day 1

Today was my first day at the Microsoft Professional Software Developers conference in Los Angelos.  The PDC09 is a conference that puts the latest versions of Microsoft Products on display. The top products to be discussed at this year’s conference include Silverlight, SQL Server 2008, Windows 7, and Windows Azure. The sessions also include information on programming, architecting, monitoring and maintaining of Microsoft technologies. Lunch and snacks are provided and there are numerous goodies to be had from Microsoft and the third party vendors taking part in the Expo. Here are some photos and video from today at the conference:

Today is just the workshops for the “high rollers” of the conference so I expect there will be more people tomorrow. the coolest thing so far from the conference was the display of Microsoft Surface. Here is a video showing some of the features.

We can share business cards and exchange photos and content on the surface table above. Cool. More tomorrow!

Top open source software for online small busines

In today’s market, many small online businesses are struggling to get started. They are trying to stretch their start-up money to the limit in an effort to minimize upfront costs. This is especially true for business infrastructure and marketing software. Well I wanted to take the time to discuss how to utilize the open source software available today that get your business up and running successfully in no time. Why buy when you can start with free proven software that scales with your business and is used by many large organizations.

The Advantages

The biggest advantage of course is that it’s free or low cost. Many open source online software is PHP based and automatically packaged with many of the top online web service providers like GoDaddy and iPowerweb.

The Disadvantages

The biggest advantage of open source software serves also as it’s biggest disadvantage. It’s free. So that means that you get limited or no support outside the online web community and your own company resource knowledge.

The Winners

The following software options are in my opinion the best open source packages available in their business class. They have enough of a user base and available books and documentation for any small online business to implement.

SugarCRM is a Customer Relationship Management System founded in 2004.  It serves as a great tool to track, market to and assist your customers while growing your business.

Joomla – is a Content Management System that is used by many businesses around the world.  In addition there are numerous free and commercial extensions.

Moodle – is a Learning Management System utilized by many large and small companies and universities. It is a great tool for training and educating people and has grow to worldwide acceptance.

What else does my business need?

I will talk about the availability of low cost managed infrastructure in a the third-party Cloud environment and the available low cost social media options like WordPress and Facebook in this month’s upcoming articles.

Next Page »


Email Subscription

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

BCWD Twitter

Past Articles