How to create UITableView in Xcode 5 Using Storyboard

When we first started the iOS programming course, we wrote a tutorial about UITableView and showed you how to create a simple table app using UITableView. This is one of our most popular tutorials. However, you may find it no longer works in Xcode 5. The latest version of Xcode promotes the use of Storyboard over Interface […]

UICollectionView custom layout tutorial

  For a recent project I needed to refactor a primary view within our iPad app, so I decided to learn the ins and outs of UICollectionView (introduced in iOS 6) and I thought it would make for a good tutorial to share. My project ended up needing a custom UICollectionViewLayout which meant I needed […]

Delegate and datasource method for UITableView

Here is all the delegate and datasource method for UITableView @protocol UITableViewDelegate @optional //Display customization – (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath; // Variable height support – (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath; – (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section; – (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section; //Section header & footer information. Views are preferred over title should you decide to provide both […]

How to add another column as image in a UITableView (Table) IOS 5

Make changes in your table delegate method as given bellow: – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ //Where we configure the cell in each row static NSString *CellIdentifier = @”Cell”; UITableViewCell *cell; cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } // Configure the cell… setting the text of […]

Show alert in IOS

Copy the simple code to show alert box UIAlertView *helloWorldAlert = [[UIAlertView alloc] initWithTitle:@”Message” message:@”your message..!” delegate:nil cancelButtonTitle:@”OK” otherButtonTitles:nil]; [helloWorldAlert show];

Navigate from one view to another IOS 5

include the class #include “MainMenu.h” write the code to change view from current to MainMenu view MainMenu *view2 = [[MainMenu alloc]initWithNibName:nil bundle:nil]; [self presentModalViewController:view2 animated:YES];

Check if Internet is available IOS 5

Copy and paste this mathod – (BOOL)isAvalableNetwork { NSString *UrlFinal =@””; dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0); int __block error1 =0 ; dispatch_sync(queue, ^{ // error1= 0; NSError *error = nil; NSURL *url = [NSURL URLWithString:UrlFinal]; NSString *json = [NSString stringWithContentsOfURL:url encoding:NSASCIIStringEncoding error:&error]; NSLog(@”Error : %@”,error); if(!error) { error1=1; } else { error1= 0; } }); […]