Read More

Creating mobile Web applications with HTML 5


Read More

game development tools


Read More

Getting Your Location in an iPhone Application
CoreLocation Tutorial

Read More

iPhone Database Example

Read More

Model View Control

Model – View – Control

MVC  was first described in 1979 by Trygve Reenskaug, then working on Smalltalk at Xerox PARC. The original implementation is described in depth in the influential paper “Applications Programming in Smalltalk-80: How to use Model–View–Controller”.

There have been several derivatives of MVC. For example, Model View Presenter is used with the .NET Framework[4], and the XForms standard uses a “model-view-controller-connector architecture”. However, standard MVC remains popular.


Though MVC comes in different flavors, control flow is generally as follows:

1.         The user interacts with the user interface in some way (for example, presses a mouse button).

2.         The controller handles the input event from the user interface, often via a registered handler or callback and converts the event into appropriate user action, understandable for the model.

3.         The controller notifies the model of the user action, possibly resulting in a change in the model’s state. (For example, the controller updates the user’s shopping cart.)

4.         A view queries the model in order to generate an appropriate user interface (for example, the view lists the shopping cart’s contents). The view gets its own data from the model. The controller may (in some implementations) issue a general instruction to the view to render itself. In others, the view is automatically notified by the model of changes in state (Observer) which require a screen update.

5.         The user interface waits for further user interactions, which restarts the cycle.

Read More

iPhone Does Well Without Being the Best

Read More

How to Make Your iPhone app send email with attachements

Here’re the Steps:

Add the Framework
Add the “MessageUI” framework to your projects “Frameworks” group folder in XCode

NOTE: if you are having trouble locating the framework follow this path: Macintosh HD>Developer>Platforms>iPhoneOS.platform>developer>SDKs>

TIP: add a shortcut to the Frameworks folder to your Finder sidebar since you will need it often

Choose a Delegate
Choose one class to act as the MFMailComposeViewControllerDelegate

Import Message Framework
Import “MessageUI.h” and “MFMailComposeViewController.h” to the header file of the delegate

Make your Delegate
Indicate that your delegate class is the delegate by including this <MFMailComposeViewControllerDelegate> in the @interface declaration

Implement the Delegate Method
Implement the “didFinishWithResult” MFMailComposeViewControllerDelegate delegate method and make sure to return control to the program by sending the dismissModalViewControllerAnimated message.

-(void)mailComposeController:(MFMailComposeViewController*)controller didFinishWithResult (MFMailComposeResult)result error:(NSError*)error {
     [self dismissModalViewControllerAnimated:YES];

Start Composing the Email Use an instance of MFMailComposeViewController to start composing the email and adding the attachments. This controller gives control to the user so s/he can decide to send or cancel the message.

-(IBAction)mailIt {MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
     picker.mailComposeDelegate = self;

     [picker setSubject:@"I have a pencil for you"];

     UIImage *roboPic = [UIImage imageNamed:@"RobotWithPencil.jpg"];
     NSData *imageData = UIImageJPEGRepresentation(roboPic, 1);
     [picker addAttachmentData:imageData mimeType:@"image/jpg" fileName:@"RobotWithPencil.jpg"];

     NSString *emailBody = @"This is a cool image of a robot I found.  Check it out!";
     [picker setMessageBody:emailBody isHTML:YES];

     [self presentModalViewController:picker animated:YES];
     [picker release];

Now if you test this out you should be able to send an email from your app.

Here is how I did the whole thing on video:

A Few Notes

So, as you can see it is pretty simple to compose an email in iPhone OS 3.0. You can use HTML tags to format the email; just insert the tags into your NSString that you send with the setMessageBody message. Attachments simply use the addAttachmentData method.

Note: this example assumes that you and your users are all up to date with iPhone OS 3.0. To see an example of how to check for this and accommodate your users who are not up to date go to the Apple Developer website and look over the source code for the project “MailComposer”.

Read More

iPhone in Business EMR

Read More

Iphone consuming web service example

Read More