How to convert string uppercase in iPhone?

Step 1: Open the Xcode, Create a new project using Single View Application. Give the application
Step 2: Need to add new viewController class in the project. Select project -> New file ->
UIViewController subclass -> next -> Give the application name “StringConvertView”.
Step 3: Now open the AppDelegate.h file and make the following changes:
#import <UIKit/UIKit.h>
@class StringConvertView;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (nonatomic, retain)IBOutlet StringConvertView *stringConvertView;
Step 4: In the AppDelegate.m file make the following changes:
#import "AppDelegate.h"
#import "StringConvertView.h"
@implementation AppDelegate
@synthesize window = _window;
@synthesize stringConvertView;
(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary
 = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
 = [UIColor whiteColor];
 = [[StringConvertView alloc]
[_window addSubview:stringConvertView.view];
[self.window makeKeyAndVisible];
return YES;
Step 4: Now open the “StringConvertView.h” file and make the following changes:
#import <UIKit/UIKit.h>
@interface StringConvertView : UIViewController
IBOutlet UIButton
IBOutlet UILabel
@property (nonatomic, retain) IBOutlet UIButton *button;
@property (nonatomic, retain) IBOutlet UILabel*resultText;
-(IBAction) uppercaseString:(id)sender;
Step 5: Double click the StringConvertView.xib file and open it to the Interface Builder. First drag
the UIButton and UILabel from the library and place it to the view window. Select the button from
the view window and bring up connection inspector and connect touch up inside to the File’s Owner
icon and select “uppercaseString:” method and connect the File’s owner icon to the label and select
“resultText”. Now save the .xib file, close it and go back to the Xcode.
Step 6: In the StringConvertView.m file make the following changes:
#import "StringConvertView.h"
@implementation StringConvertView
@synthesize button,resultText;
-(IBAction) uppercaseString:(id)sender
NSString *string1 = @"welcome to iPhone";
NSString *upperString = [[NSString alloc] initWithFormat:string1];
NSStringchangeString = [upperString uppercaseString];
 = changeString ;
(id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
 = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
return self;
// Releases the view if it doesn’t have a superview.
[super didReceiveMemoryWarning];
// Release any cached data, images, etc that aren’t in use.
#pragma mark – View lifecycle
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
Step 7: Now compile and run the application on the Simulator.