Moving Onto The Next UITextField When ‘Next’ Is Tapped

You need to make your view controller the UITextField delegate, and implement the UITextField delegate method: – (BOOL)textFieldShouldReturn:(UITextField *)textField { if (textField == nameField) { [textField resignFirstResponder]; [emailField becomeFirstResponder]; } else if (textField == emailField) { // here you can define what happens // when user presses return on the email field } return YES; … Read more

how to get ip address of iphone programmatically [duplicate]

#include <ifaddrs.h> #include <arpa/inet.h> // Get the INTERNAL ip address – (NSString *)getIPAddress { NSString *address = @”error”; struct ifaddrs *interfaces = NULL; struct ifaddrs *temp_addr = NULL; int success = 0; // retrieve the current interfaces – returns 0 on success success = getifaddrs(&interfaces); if (success == 0) { // Loop through linked list … Read more

UITableView With Multiple Sections

– (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 2 ; } – (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (section==0) { return [array1 count]; } else{ return [array2 count]; } } – (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if(section == 0) return @”Section 1″; else return @”Section 2″; } – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @”Cell”; … Read more