Category in IOS

Create a new project in xocde under Single View Application, Create a new Objective-C Category file named NewCategory under subclass of NSString, In ViewController.h #import #import “NSString+NewCategory.h” @interface ViewController : UIViewController { IBOutlet UITextField *text1; IBOutlet UITextField *text2; } – (IBAction)removeDotsButton:(id)sender; -(IBAction)retunkey:(id)sender; @end In ViewController.m #import “ViewController.h” @interface ViewController () @end @implementation ViewController – (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } – (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be…

Continue reading »

ScartchCard Implementation in IOS

Create a new project in xcode under Single View Application, Download the ScratchCard Files from the below download link and import the fils into your project, http://www.mediafire.com/folder/hng3rx6nhit97/ScratchCard In ViewController.h #import @interface ViewController : UIViewController { IBOutlet UILabel *numberlabel; } @end In ViewController.m #import “ViewController.h” @interface ViewController () @end @implementation ViewController – (void)viewDidLoad { [super viewDidLoad]; numberlabel.text = @”12345678″; } – (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } @end Go to the ViewController.xib and click the xib and goto the Identity Inspector and set the class name as…

Continue reading »

MultiThread in IOS

Create a new project in xcode under Single View Application, Design & Output looks like this, Output Explanation First Click on Start Thread – Main Thread & BackGround Thread Gets Started – Also can move slider – Main Thread gets Completed – BackGround Thread gets Completed – Final View In ViewController.h #import @interface ViewController : UIViewController { NSThread *BackgroundThread; BOOL BackgroundThreadCancel; } @property (strong,nonatomic) IBOutlet UIProgressView *progressView; @property (strong,nonatomic) IBOutlet UILabel *label1; @property (strong,nonatomic) IBOutlet UISlider *sliderView; @property (strong,nonatomic) IBOutlet UILabel *label2; @property (strong,nonatomic) IBOutlet…

Continue reading »