RSS

Monthly Archives: July 2011

How to use UIImageView in iPhone for animation

n this application we will see , how to use UIImagesView to view without using Interface Builder. Basically images are working with an infinite loop . Just have a look.

Step 1: Create a View base application using template. Give the application name “Animation”.

Step 2: Xcode automatically creates the directory structure and adds essential frameworks to it. You can explore the directory structure to check out the content of the directory.

Step 3: We need to add the resources file called as “1.gif”, “2.gif” , “3.gif”,  ”4.gif”, “5.gif”, “6.gif” into the resource folder. Select resources and add files existing sources.

Step 4: Open the AnimationViewController.m file and make the following changes in the file.

– (void)viewDidLoad {
UIImageView*animationView = [[UIImageView alloc] initWithFrame:self.view.frame];
animationView.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@”1.gif”],
[UIImage imageNamed:@”2.gif”],
[UIImage imageNamed:@”3.gif”],
[UIImage imageNamed:@”4.gif”],
[UIImage imageNamed:@”5.gif”],
[UIImage imageNamed:@”6.gif”], nil];

animationView.animationDuration = 1.25;
animationView.animationRepeatCount = 0;
[animationView startAnimating];
[self.view addSubview:animationView];
[animationView release];

}

Step 5: Now compile and run the application in the Simulator.

 

You can downloaded SourceCode from here Animation 2

 

Original Post

Advertisements
 
Leave a comment

Posted by on July 10, 2011 in iPhone

 

How to use datePicker in iPhone (UIDatePicker)

Step 1: The first thing we need to do is to  indicate that our view controller would be acting as a UITextField. To do this you simply need to declare it in the interface file:

#import <UIKit/UIKit.h>
@interface DatePickerViewController : UIViewController {
IBOutlet UIDatePicker *datePicker;
}
@end

Step 2: Now,double click .xib file and open Interface Builder. We need a date picker,so look for Date Picker in the Library,and drag one over to the View Window .Then Save close the nib and go back to xcode.

Step 3: In the ViewDidLoad,We create new NSDate object. An NSDate object created this way will hold the current date and time. We then set datePicker to that date,which ensure every time this view loads, the Picker will reset to the current date and time.

– (void)viewDidLoad {
NSDate *now = [[NSDate alloc] init];
[datePicker setDate:now animated:YES];
[now release];
[super viewDidLoad];
}

Step 4: Double click .xib file and open Interface Builder.  Grab Round Rect Button from the Library,and place it below the Date Picker.Double click it,and give it a title of “Select”. Save,close the nib, and go to the xcode.

Step 5: We added the implementation of button Pressed and we overrode viewDidLoad.

-(IBAction)buttonPressed:(id)sender{
NSDate *selected =[datePicker date];
NSString *message =[[NSString alloc] initWithFormat:
@”The Date and Time you selected is: %@”,selected];
UIAlertView *alert=[[UIAlertView alloc] initWithTitle:
@”Date and Time Selected”
message:message
delegate:nil
cancelButtonTitle:@”Yes, I did.”
otherButtonTitles:nil];
[alert show];
[alert release];
[message release];
}
You can Download SourceCode from here DatePicker
 
Leave a comment

Posted by on July 10, 2011 in iPhone

 

how to use PickerView in iPhone (UIPickerView )

Outstanding article

#import "ViewController.h"
@implementation ViewController
@synthesize mlabel;

- (void)viewDidLoad
{
	[super viewDidLoad];
	arrayNo = [[NSMutableArray alloc] init];
	[arrayNo addObject:@" Hello "];
	[arrayNo addObject:@" Hai "];
	[arrayNo addObject:@" Picker "];
	[arrayNo addObject:@" Simple "];
	[arrayNo addObject:@" example "];

	[pickerView selectRow:1 inComponent:0 animated:NO];
	mlabel.text= [arrayNo objectAtIndex:[pickerView selectedRowInComponent:0]];
}

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView;
{
	return 1;
}

- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
	mlabel.text= [arrayNo objectAtIndex:row];
}

- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)component;
{
	return [arrayNo count];
}

- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component;
{
	return [arrayNo objectAtIndex:row];
}

/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
[super viewDidLoad];
}
*/

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

- (void)didReceiveMemoryWarning
{
	// Releases the view if it doesn't have a superview.
	[super didReceiveMemoryWarning];

	// Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload
{
	// Release any retained subviews of the main view.
	// e.g. self.myOutlet = nil;
}

- (void)dealloc
{
	[super dealloc];
}
@end

Original Post

 
Leave a comment

Posted by on July 9, 2011 in iPhone

 

HTML 5 canvas game

http://www.html5canvastutorials.com/canvas-hero/

 
Leave a comment

Posted by on July 5, 2011 in GAME, HTML 5

 

Rumors claim Apple’s iPhone 5 and iPad 3 Suppliers Gearing up for October Launch

A new report by DigiTimes is claiming that the companies that manufacture and supply components to be used in the production of Apple’s next-generation iPhone and iPad devices are preparing for an October launch of both of these devices. The report cites sources throughout Apple’s supply chain and claims that Apple will be launching a single new iPhone model, which is expected as there was no new iPhone hardware previewed at the 2011 Worldwide Developers Conference, alongside the iPad 3.

While the iPhone rumors are hardly new, the iPad 3 news is somewhat surprising and contradicts what many had previously reported about the next iPad, including a report made this week by a FBR Capital Markets analyst stating that prototype iPad 3 models wouldn’t even appear until 2012. Apple launched the iPad 2 just a few months ago, packing quite a few improvements but lacking an upgraded display which dismayed journalists and users alike. The DigiTimes report claims that the new iPad 3 will remedy the display issue, with a source quoted that “Apple is considering designing an even thinner and lighter tablet PC with its panel resolution increasing to 250dpi.”

Read More

 
Leave a comment

Posted by on July 5, 2011 in iPhone

 

iPhone 5 Release Date and Features

iPhone 5 Release Date might be most buzzing topic among tech geeks.  Each day is rising with a new rumor or a speculative guess about iPhone 5 launch date. CNET UK, a top internet review site for electronics, has grabbed attention of the techies posting update on iPhone 5 release date.

According to CNET UK, iPhone 5 release date is likely to be September 7th 2011. We guess this is the first exact date prediction about launch of the next generation iPhone.

 

Read More

 

 
Leave a comment

Posted by on July 5, 2011 in iPhone

 

Create views with flash builder 4.5

Tutorial

In this tutorial, you create an additional application view to display employee details. This view will be displayed when the user selects an employee in the home view.

Because of the smaller screen sizes typical on mobile devices, mobile applications follow very different design patterns from web and desktop applications. When developing for mobile applications, you typically break down the content to a series of views that can be displayed on the mobile device. Each view should contain components focused on a single task or set of information. The user typically “drills down” from one view to another for details, using a back button or touch swipe to return to the more general information.

 

Read More

 
2 Comments

Posted by on July 3, 2011 in Flash Builder 4.5, Mobile Technology