App store screenshots sizes for all devices

The iPhone 6 and iPhone 6 Plus screenshots don’t accept cropped (without status bar) uploads. 6.5in (iPhone XS Max): 1242 x 2688px portrait 5.8in (iPhone XR): 828 x 1792px portrait 5.8in (iPhone X, iPhone XS): 1125 x 2436px portrait 5.5in (iPhone 6 Plus, iPhone 6S Plus, iPhone 7 Plus, iPhone 8 Plus): 1242 × 2208px … Read more

Center UIPickerView Text

– (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view { UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 300, 37)]; label.text = [NSString stringWithFormat:@”something here”]; label.textAlignment = NSTextAlignmentCenter; //Changed to NS as UI is deprecated. label.backgroundColor = [UIColor clearColor]; [label autorelease]; return label; } or something like this.

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

iPhone UITableView with a header area

You can use UITableViewDelegate methods to create a custom header view for a table and specify the height, namely tableView:viewForHeaderInSection: and tableView:heightForHeaderInSection:. You can add whatever you like to the view. Here’s an example that adds a right aligned UILabel: – (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *headerView = [[UIView alloc] initWithFrame:CGRectMake(0,0,tableView.frame.size.width,30)]; UILabel *headerLabel = … Read more