MikeTeo.net

A Software Technologist's Blog (Wanna Email Me?)

Archive for the ‘iOS’ Category

The code originates from http://blog.andrewpaulsimmons.com/2008/07/md5-hash-on-iphone.html.
I have copied it here for mirroring purposes. Please express your appreciations to Andrew for his efforts.

#import <CommonCrypto/CommonDigest.h>

NSString* md5( NSString *str )
{
   const char *cStr = [str UTF8String];
   unsigned char result[CC_MD5_DIGEST_LENGTH];
   CC_MD5( cStr, strlen(cStr), result );
   return [NSString  stringWithFormat:
       @"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X",
       result[0], result[1], result[2], result[3], result[4],
       result[5], result[6], result[7],
       result[8], result[9], result[10], result[11], result[12],
       result[13], result[14], result[15]
   ];
}

Simple iPhone Tutorial (Part 3)

Aug-31-2008 By miketeo

With the completion of Part 2, the user interface of your application is almost ready. However, it does not serve much purpose since it does not interact with the users. In this last part of the tutorial, you will add in action handlers using addTarget API and @selector to capture user actions.

Read the rest of this entry »

Simple iPhone Tutorial (Part 2)

Aug-31-2008 By miketeo

In Part 1, we have created a tutorial project, initialized the main screen with 2 tabs, and have attached a custom table view for the first tab. In Part 2, we are going to add a custom form view for the second tab.

Read the rest of this entry »

Simple iPhone Tutorial (Part 1)

Aug-31-2008 By miketeo

The iPhone developer center provides a great library of information of developing applications on iPhone. However, it assumes that the developer has some relative experience in developing applications on Cocoa. For developers like me who have decided to give iPhone development a try for the first time, there is undoubtedly a great hurdle to leap across.

I have put together this simple howto tutorial to illustrate some of the key features which I have picked from books (books on IPhone SDK development are seriously lacking at this point in time) and online materials that exist in bits and pieces all over the Internet. The illustrated features may not be the best solutions for the problems, but I believe they are rather straightforward and easier to align with my thought process (having come from a few years of development in MFC/Visual C++).

The tutorial will show you how to:

  • Create an iPhone application from an empty application template.
  • Add a 2-tabs tab control view for your main window on your iPhone screen.
  • Create a child view for the first tab which contains a Navigation bar (I use it for the title because it looks good), and a Table view.
  • Create another child view for the second tab which is basically a form-based view designed through the Interface Builder.
  • Load these two child views dynamically from their xib files.
  • Generate table cells which contain a label, and a on/off switch or a slider control through coding
  • Adding action handlers to the on/off switch controls and slider controls in the dynamically-generated table cells.
  • Capturing the changes in the states of the on/off switches and slider controls on the first tab view and display the states on the second tab view (form-based view).

Read the rest of this entry »