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 convert integer to string? [duplicate]

NSArray *myArray = [NSArray arrayWithObjects:[NSNumber numberWithInt:1], [NSNumber numberWithInt:2], [NSNumber numberWithInt:3]]; Update for new Objective-C syntax: NSArray *myArray = @[@1, @2, @3]; Those two declarations are identical from the compiler’s perspective. if you’re just wanting to use an integer in a string for putting into a textbox or something: int myInteger = 5; NSString* myNewString = …

Read more

Push ViewController from Right To Left with UINavigationController

You can create a NSMutableArray from the navigationController’s array of viewcontrollers and insert new viewController before the current one. Then set the viewControllers array without animation and pop back. UIViewController *newVC = …; NSMutableArray *vcs = [NSMutableArray arrayWithArray:self.navigationController.viewControllers]; [vcs insertObject:newVC atIndex:[vcs count]-1]; [self.navigationController setViewControllers:vcs animated:NO]; [self.navigationController popViewControllerAnimated:YES];

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

How to NSLog a CGRect [duplicate]

You need to use NSStringFromCGRect which will convert the CG structs into NSString, Refer below:- NSLog(@”%@”, NSStringFromCGRect(frame)); Also below are the following other functions which can be used for NSLog CG Structs as well:- NSStringFromCGPoint NSStringFromCGSize NSStringFromCGRect NSStringFromCGAffineTransform NSStringFromUIEdgeInsets