Click here to Skip to main content
15,031,872 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I created the single view application using storyboard.
I have viewcontoller.h file

Objective-C
#import <UIKit/UIKit.h>
    
    @interface ViewController : UIViewController<UITableViewDelegate, UITableViewDataSource>
    
    
    @end

I have viewcontoller.m file
Objective-C
#import "ViewController.h"
    
    @interface ViewController ()
    
    @end
    
    @implementation ViewController
    {
        NSArray *recipes;
    }
    - (void)viewDidLoad {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
        recipes = [NSArray arrayWithObjects:@"Egg Benedict", @"Mushroom Risotto", @"Full Breakfast", @"Hamburger", @"Ham and Egg Sandwich", @"Creme Brelee", @"White Chocolate Donut", @"Starbucks Coffee", @"Vegetable Curry", @"Instant Noodle with Egg", @"Noodle with BBQ Pork", @"Japanese Noodle with Pork", @"Green Tea", @"Thai Shrimp Cake", @"Angry Birds Cake", @"Ham and Cheese Panini", nil];
    }
    -(NSInteger)tableView :(UITableView *)tableView numberOfRowsInSection :(NSInteger)section
    {
        return [recipes count];
    
    }
    -(UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *simpleTableIdentifier=@"RecpieCell";
        UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:simpleTableIdentifier];
        if(cell ==nil)
        {
            cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:simpleTableIdentifier];
        }
        
        cell.textLabel.text=[recipes objectAtIndex:indexPath.row];
        return cell;
        
    }

    @end

In storyboard file, i have three view controller

> 1-navigation controller 2-Recipe Book View Controller 3-View
> Controller

Prototype cell of the table view of Recipe Book View Controller is connected through push segue to View Controller.Is the problem Recipe Book View Controller does not navigate to View Controller?

What I have tried:

www.google.com .I have seen tutorial on [^] .
From this link you can download the sample for correction dropbox.com/s/kpybdmtov7i0wne/RecipeBook.zip?dl=0 
Posted
Updated 28-Jun-17 0:19am
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900