IOS AlertView

Published on

-(IBAction)click:(id)sender { alert1=[[UIAlertView alloc]initWithTitle:@”clicl alert view button” message:@”go to next page” delegate:self cancelButtonTitle:@”cancel” otherButtonTitles:@”ok”, nil]; [alert1 show]; } – (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex { if(buttonIndex==1) { NSLog(@”okbutton”); } else if (buttonIndex==0) { NSLog(@”cancelbutton”); } }

How to find current latitude and longitude

Published on

Add corelocation.framework import <CoreLocation/CoreLocation.h> Create the object in corelocationmanager Ex:@property (nonatomic, retain) CLLocationManager *locationManager; locationManager = [[CLLocationManager alloc] init]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; locationManager.distanceFilter = kCLDistanceFilterNone; [locationManager startUpdatingLocation]; CLLocation *location = [locationManager location]; // Configure the new event with information from the location CLLocationCoordinate2D coordinate = [location coordinate]; NSString *latitude = [NSString stringWithFormat:@”%f”, … Continue reading How to find current latitude and longitude

Create Done Button In Number pad

Published on

– (void)loadView { self.view = [[UIView alloc] initWithFrame:[UIScreen mainScreen].applicationFrame]; self.view.backgroundColor = [UIColor groupTableViewBackgroundColor]; textField = [[UITextField alloc] initWithFrame:CGRectMake(10, 200, 300, 26)]; textField.borderStyle = UITextBorderStyleRoundedRect; textField.keyboardType = UIKeyboardTypeNumberPad; textField.returnKeyType = UIReturnKeyDone; textField.textAlignment = UITextAlignmentLeft; textField.text = @”12345″; [self.view addSubview:textField]; // add observer for the respective notifications (depending on the os version) if ([[[UIDevice currentDevice] systemVersion] floatValue] … Continue reading Create Done Button In Number pad

Create custom cell in table view

Published on

Create TableView in ViewController Right click in ViewController open New file Select objective-c class Click Next Create TableViewCell name and Select subclass:”UiTableViewCell” Click next then create a TableViewCell Add a Empty Xib. Drag the TableViewCell in that empty Xib. Select the TableViewCell,Select Identity and Type and Give the class name as TableViewCell   – (UITableViewCell … Continue reading Create custom cell in table view

Delete The TableView Cell

Published on

Create the button and write the action: – (IBAction) EditTable:(id)sender { if(self.editing) { [super setEditing:NO animated:NO]; [tableView1 setEditing:NO animated:NO]; [tableView1 reloadData]; [edit_btn setTitle:@”Edit”]; } else { [super setEditing:YES animated:YES]; [tableView1 setEditing:YES animated:YES]; [tableView1 reloadData]; [edit_btn setTitle:@”Done”]; } } Tableview cellĀ  editing Delegate methods: – (UITableViewCellEditingStyle)tableView:(UITableView *)aTableView editingStyleForRowAtIndexPath:(NSIndexPath *)indexPath { if (self.editing && indexPath.row == ([cityArray … Continue reading Delete The TableView Cell