Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如何从选定的UITableView页面跳转到scrollView?_Objective C_Xcode_Scrollview_Tableview - Fatal编程技术网

Objective c 如何从选定的UITableView页面跳转到scrollView?

Objective c 如何从选定的UITableView页面跳转到scrollView?,objective-c,xcode,scrollview,tableview,Objective C,Xcode,Scrollview,Tableview,我正在制作类似iOS应用程序的目录。将Xcode 4.2与故事板一起使用 此应用程序有两个视图,每个视图都可以通过选项卡栏控制器进行更改 应用程序图像在这里 我制作了目录视图和目录(TableView)。 但我无法将视图从目录更改为目录视图 我认为当目录的页码值被单击时,目录视图的变量和视图的更改将是一个好的结果 第一个视图是目录视图。 它由FirstViewController控制,对于图像比例的更改,PageView类也使用 第二个视图是目录,由ListViewController控制。它是

我正在制作类似iOS应用程序的目录。将Xcode 4.2与故事板一起使用

此应用程序有两个视图,每个视图都可以通过选项卡栏控制器进行更改

应用程序图像在这里

我制作了目录视图和目录(TableView)。 但我无法将视图从目录更改为目录视图

我认为当目录的页码值被单击时,目录视图的变量和视图的更改将是一个好的结果

第一个视图是目录视图。 它由FirstViewController控制,对于图像比例的更改,PageView类也使用

第二个视图是目录,由ListViewController控制。它是解析plist(xml),并操作单元格值(标题和页码)

代码如下,请帮助

FirstViewController
@ContentSecondViewController的实现表

    @synthesize currentPage;

    - (void)didReceiveMemoryWarning
    {
        [super didReceiveMemoryWarning];
        // Release any cached data, images, etc that aren't in use.
    }

    #pragma mark - View lifecycle

    -(void)pageLoad:(UIScrollView *)scrollView {

        currentPage = scrollView.contentOffset.x / scrollView.bounds.size.width;

        NSLog(@"CurrentPage- %i",currentPage);
        NSLog(@"CurrentOffSet- %f",scrollView.contentOffset.x);

        int pageWidth = self.view.frame.size.width;
        int pageHeight = self.view.frame.size.height;

        NSLog(@"pageWidth- %i",pageWidth);

        prevPage.frame = CGRectMake(
                                    pageWidth * (currentPage - 1), 
                                    0, 
                                    pageWidth, 
                                    pageHeight
                                    );

        if (currentPage > 0) {
            [prevPage setImage:[NSString stringWithFormat:@"%d", (currentPage - 1) % kPageNum]];
            prevPage.hidden = NO;
        }
        else {
            prevPage.hidden = YES;
        }

        currPage.frame = CGRectMake(
                                       pageWidth * currentPage, 
                                       0, 
                                       pageWidth, 
                                       pageHeight
                                       );

        [currPage setImage:[NSString stringWithFormat:@"%d", currentPage % kPageNum]];
        currPage.hidden = NO;

        nextPage.frame = CGRectMake(
                                    pageWidth * (currentPage + 1), 
                                    0, 
                                    pageWidth, 
                                    pageHeight
                                    );

        if(currentPage < (kPageNum -1)) {
            [nextPage setImage:[NSString stringWithFormat:@"%d", (currentPage + 1) % kPageNum]];

            nextPage.hidden = NO;
        }
        else {
            nextPage.hidden = YES;
        }
    }


    #pragma mark - View lifecycle

    - (void)viewDidLoad
    {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.

        UIScrollView *scrollView = [[UIScrollView alloc] init];

        scrollView.frame = self.view.bounds;
        scrollView.contentSize = CGSizeMake(self.view.frame.size.width * kPageNum,
                                            self.view.frame.size.height
                                            );

        //NSLog(@"ContentSize- %@",NSStringFromCGSize(scrollView.contentSize));

        scrollView.pagingEnabled = YES;
        [self.view addSubview:scrollView];

        scrollView.delegate = self;

        prevPage = [[PageView alloc] initWithFrame:self.view.bounds];
        [scrollView addSubview:prevPage];

        currPage = [[PageView alloc] initWithFrame:self.view.bounds];
        [scrollView addSubview:currPage];

        nextPage = [[PageView alloc] initWithFrame:self.view.bounds];
        [scrollView addSubview:nextPage];

        [self pageLoad:scrollView];

    }

    -(void)scrollViewDidScroll:(UIScrollView *)scrollView {
        CGFloat position = scrollView.contentOffset.x / scrollView.bounds.size.width;

        CGFloat delta = position - (CGFloat)currentPage;

        if (fabs(delta) >= 1.0f) {
            [self pageLoad:scrollView];
        }

        //NSLog(@"ContentOffset- %f", scrollView.contentOffset.x);
    }

    - (void)viewDidUnload
    {
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
            return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
        } else {
            return YES;
        }
    }

    @end
SecondViewController用于目录。 如果没有子元素,请返回页码

ListViewController.m

    @implementation ListViewController

    @synthesize tableDataSource,currentTitle,currentLevel;


    - (id)initWithStyle:(UITableViewStyle)style
    {
        self = [super initWithStyle:style];
        if (self) {
            // Custom initialization
        }
        return self;
    }

    - (void)didReceiveMemoryWarning
    {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];

        // Release any cached data, images, etc that aren't in use.
    }

    #pragma mark - View lifecycle

    - (void)viewDidLoad
    {
        [super viewDidLoad];

        if(currentLevel == 0) {
            NSArray *tempArray = [[NSArray alloc] init];
            self.tableDataSource = tempArray;

            TableOfContentAppDelegate *AppDelegate = (TableOfContentAppDelegate *)[[UIApplication sharedApplication] delegate];
            self.tableDataSource = [AppDelegate.data objectForKey:@"Rows"];
            self.navigationItem.title = @"Table of Contents";
        }
        else
            self.navigationItem.title = currentTitle;

        // Uncomment the following line to preserve selection between presentations.
        // self.clearsSelectionOnViewWillAppear = NO;

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    }

    - (void)viewDidUnload
    {
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    }

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
    }

    - (void)viewDidAppear:(BOOL)animated
    {
        [super viewDidAppear:animated];
    }

    - (void)viewWillDisappear:(BOOL)animated
    {
        [super viewWillDisappear:animated];
    }

    - (void)viewDidDisappear:(BOOL)animated
    {
        [super viewDidDisappear:animated];
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }

    #pragma mark - Table view data source

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    {
    #warning Potentially incomplete method implementation.
        // Return the number of sections.
        return 1;
    }

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    #warning Incomplete method implementation.
        // Return the number of rows in the section.
        return [self.tableDataSource count];
    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"Cell";

        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
        NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
        cell.textLabel.text = [dictionary objectForKey:@"Title"];

        return cell;

        // Configure the cell...

        return cell;
    }



    #pragma mark - Table view delegate

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {

        NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];

        NSArray *Children = [dictionary objectForKey:@"Children"];

        if([Children count] == 0) {

            /* I want to Jump to selected page on scrollView */

        }
        else {
            ListViewController *rvController = [[ListViewController alloc] initWithStyle:UITableViewStylePlain];

            rvController.currentLevel += 1;

            rvController.currentTitle = [dictionary objectForKey:@"Title"];

            [self.navigationController pushViewController:rvController animated:YES];

            rvController.tableDataSource = Children;
        }

        // Navigation logic may go here. Create and push another view controller.
        /*
         <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
         // ...
         // Pass the selected object to the new view controller.
         [self.navigationController pushViewController:detailViewController animated:YES];
         */
    }

    @end        @implementation ListViewController

    @synthesize tableDataSource,currentTitle,currentLevel;


    - (id)initWithStyle:(UITableViewStyle)style
    {
        self = [super initWithStyle:style];
        if (self) {
            // Custom initialization
        }
        return self;
    }

    - (void)didReceiveMemoryWarning
    {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];

        // Release any cached data, images, etc that aren't in use.
    }

    #pragma mark - View lifecycle

    - (void)viewDidLoad
    {
        [super viewDidLoad];

        if(currentLevel == 0) {
            NSArray *tempArray = [[NSArray alloc] init];
            self.tableDataSource = tempArray;

            TableOfContentAppDelegate *AppDelegate = (TableOfContentAppDelegate *)[[UIApplication sharedApplication] delegate];
            self.tableDataSource = [AppDelegate.data objectForKey:@"Rows"];
            self.navigationItem.title = @"Table of Contens";
        }
        else
            self.navigationItem.title = currentTitle;

        // Uncomment the following line to preserve selection between presentations.
        // self.clearsSelectionOnViewWillAppear = NO;

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    }

    - (void)viewDidUnload
    {
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    }

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
    }

    - (void)viewDidAppear:(BOOL)animated
    {
        [super viewDidAppear:animated];
    }

    - (void)viewWillDisappear:(BOOL)animated
    {
        [super viewWillDisappear:animated];
    }

    - (void)viewDidDisappear:(BOOL)animated
    {
        [super viewDidDisappear:animated];
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }

    #pragma mark - Table view data source

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    {
    #warning Potentially incomplete method implementation.
        // Return the number of sections.
        return 1;
    }

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    #warning Incomplete method implementation.
        // Return the number of rows in the section.
        return [self.tableDataSource count];
    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"Cell";

        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
        NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
        cell.textLabel.text = [dictionary objectForKey:@"Title"];

        return cell;

        // Configure the cell...

        return cell;
    }



    #pragma mark - Table view delegate

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {

        NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];

        NSArray *Children = [dictionary objectForKey:@"Children"];

        if([Children count] == 0) {

            /* I want to Jump to selected page on scrollView */

        }
        else {
            ListViewController *rvController = [[ListViewController alloc] initWithStyle:UITableViewStylePlain];

            rvController.currentLevel += 1;

            rvController.currentTitle = [dictionary objectForKey:@"Title"];

            [self.navigationController pushViewController:rvController animated:YES];

            rvController.tableDataSource = Children;
        }

        // Navigation logic may go here. Create and push another view controller.
        /*
         <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
         // ...
         // Pass the selected object to the new view controller.
         [self.navigationController pushViewController:detailViewController animated:YES];
         */
    }

    @end
@实现ListViewController
@综合tableDataSource、currentTitle、currentLevel;
-(id)initWithStyle:(UITableViewStyle)样式
{
self=[super initWithStyle:style];
如果(自我){
//自定义初始化
}
回归自我;
}
-(无效)未收到记忆警告
{
//如果视图没有superview,则释放该视图。
[超级记忆警告];
//释放所有未使用的缓存数据、图像等。
}
#pragma标记-视图生命周期
-(无效)viewDidLoad
{
[超级视图下载];
如果(currentLevel==0){
NSArray*tempArray=[[NSArray alloc]init];
self.tableDataSource=tempArray;
TableOfContentAppDelegate*AppDelegate=(TableOfContentAppDelegate*)[[UIApplication sharedApplication]委托];
self.tableDataSource=[AppDelegate.data objectForKey:@“行”];
self.navigationItem.title=@“目录”;
}
其他的
self.navigationItem.title=当前标题;
//取消对下一行的注释以保留演示文稿之间的选择。
//self.clearselectiononviewwillappear=否;
//取消对以下行的注释,以在此视图控制器的导航栏中显示编辑按钮。
//self.navigationItem.rightBarButtonItem=self.editButtonItem;
}
-(无效)视图卸载
{
[超级视频下载];
//释放主视图的所有保留子视图。
//例如,self.myOutlet=nil;
}
-(无效)视图将显示:(BOOL)动画
{
[超级视图将显示:动画];
}
-(无效)视图显示:(BOOL)动画
{
[超级视图显示:动画];
}
-(无效)视图将消失:(BOOL)已设置动画
{
[超级视图将消失:动画];
}
-(无效)视图消失:(BOOL)已设置动画
{
[超级视窗消失:动画];
}
-(布尔)应自动旋转指针面定向:(UIInterfaceOrientation)interfaceOrientation
{
//对于支持的方向返回YES
返回(interfaceOrientation==UIInterfaceOrientationGraphic);
}
#pragma标记-表视图数据源
-(NSInteger)表格视图中的节数:(UITableView*)表格视图
{
#警告:方法实现可能不完整。
//返回节数。
返回1;
}
-(NSInteger)表视图:(UITableView*)表视图行数节:(NSInteger)节
{
#警告:方法实现不完整。
//返回节中的行数。
返回[self.tableDataSource count];
}
-(UITableViewCell*)tableView:(UITableView*)tableView cellForRowAtIndexPath:(NSIndexPath*)indexPath
{
静态NSString*CellIdentifier=@“Cell”;
UITableViewCell*单元格=[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
如果(单元格==nil){
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault重用标识符:CellIdentifier];
}
NSDictionary*dictionary=[self.tableDataSource objectAtIndex:indexath.row];
cell.textlab.text=[dictionary objectForKey:@“Title”];
返回单元;
//配置单元格。。。
返回单元;
}
#pragma标记-表视图委托
-(void)tableView:(UITableView*)tableView未选择RowatineXpath:(NSIndexPath*)indexPath
{
NSDictionary*dictionary=[self.tableDataSource objectAtIndex:indexath.row];
NSArray*Children=[dictionary objectForKey:@“Children”];
如果([子项计数]==0){
/*我想跳转到scrollView上的所选页面*/
}
否则{
ListViewController*rvController=[[ListViewController alloc]initWithStyle:UITableViewStylePlain];
rvController.currentLevel+=1;
rvController.currentTitle=[dictionary objectForKey:@“Title]”;
[self.navigationController pushViewController:rvController动画:是];
rvController.tableDataSource=子级;
}
//导航逻辑可能位于此处。创建并推送另一个视图控制器。
/*
*detailViewController=[[alloc]initWithNibName:@“bundle:nil];
// ...
//将选定对象传递给新的视图控制器。
[self.navigationController pushViewController:detailViewController动画:是];
*/
}
@end@implementation ListViewController
@综合tableDataSource、currentTitle、currentLevel;
-(id)initWithStyle:(UITableViewStyle)样式
{
self=[super initWithStyle:style];
如果(自我){
//自定义初始化
}
回归自我;
}
-(无效)未收到记忆警告
{
//如果视图没有superview,则释放该视图。
    @implementation ListViewController

    @synthesize tableDataSource,currentTitle,currentLevel;


    - (id)initWithStyle:(UITableViewStyle)style
    {
        self = [super initWithStyle:style];
        if (self) {
            // Custom initialization
        }
        return self;
    }

    - (void)didReceiveMemoryWarning
    {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];

        // Release any cached data, images, etc that aren't in use.
    }

    #pragma mark - View lifecycle

    - (void)viewDidLoad
    {
        [super viewDidLoad];

        if(currentLevel == 0) {
            NSArray *tempArray = [[NSArray alloc] init];
            self.tableDataSource = tempArray;

            TableOfContentAppDelegate *AppDelegate = (TableOfContentAppDelegate *)[[UIApplication sharedApplication] delegate];
            self.tableDataSource = [AppDelegate.data objectForKey:@"Rows"];
            self.navigationItem.title = @"Table of Contents";
        }
        else
            self.navigationItem.title = currentTitle;

        // Uncomment the following line to preserve selection between presentations.
        // self.clearsSelectionOnViewWillAppear = NO;

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    }

    - (void)viewDidUnload
    {
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    }

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
    }

    - (void)viewDidAppear:(BOOL)animated
    {
        [super viewDidAppear:animated];
    }

    - (void)viewWillDisappear:(BOOL)animated
    {
        [super viewWillDisappear:animated];
    }

    - (void)viewDidDisappear:(BOOL)animated
    {
        [super viewDidDisappear:animated];
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }

    #pragma mark - Table view data source

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    {
    #warning Potentially incomplete method implementation.
        // Return the number of sections.
        return 1;
    }

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    #warning Incomplete method implementation.
        // Return the number of rows in the section.
        return [self.tableDataSource count];
    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"Cell";

        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
        NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
        cell.textLabel.text = [dictionary objectForKey:@"Title"];

        return cell;

        // Configure the cell...

        return cell;
    }



    #pragma mark - Table view delegate

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {

        NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];

        NSArray *Children = [dictionary objectForKey:@"Children"];

        if([Children count] == 0) {

            /* I want to Jump to selected page on scrollView */

        }
        else {
            ListViewController *rvController = [[ListViewController alloc] initWithStyle:UITableViewStylePlain];

            rvController.currentLevel += 1;

            rvController.currentTitle = [dictionary objectForKey:@"Title"];

            [self.navigationController pushViewController:rvController animated:YES];

            rvController.tableDataSource = Children;
        }

        // Navigation logic may go here. Create and push another view controller.
        /*
         <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
         // ...
         // Pass the selected object to the new view controller.
         [self.navigationController pushViewController:detailViewController animated:YES];
         */
    }

    @end        @implementation ListViewController

    @synthesize tableDataSource,currentTitle,currentLevel;


    - (id)initWithStyle:(UITableViewStyle)style
    {
        self = [super initWithStyle:style];
        if (self) {
            // Custom initialization
        }
        return self;
    }

    - (void)didReceiveMemoryWarning
    {
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];

        // Release any cached data, images, etc that aren't in use.
    }

    #pragma mark - View lifecycle

    - (void)viewDidLoad
    {
        [super viewDidLoad];

        if(currentLevel == 0) {
            NSArray *tempArray = [[NSArray alloc] init];
            self.tableDataSource = tempArray;

            TableOfContentAppDelegate *AppDelegate = (TableOfContentAppDelegate *)[[UIApplication sharedApplication] delegate];
            self.tableDataSource = [AppDelegate.data objectForKey:@"Rows"];
            self.navigationItem.title = @"Table of Contens";
        }
        else
            self.navigationItem.title = currentTitle;

        // Uncomment the following line to preserve selection between presentations.
        // self.clearsSelectionOnViewWillAppear = NO;

        // Uncomment the following line to display an Edit button in the navigation bar for this view controller.
        // self.navigationItem.rightBarButtonItem = self.editButtonItem;
    }

    - (void)viewDidUnload
    {
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    }

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
    }

    - (void)viewDidAppear:(BOOL)animated
    {
        [super viewDidAppear:animated];
    }

    - (void)viewWillDisappear:(BOOL)animated
    {
        [super viewWillDisappear:animated];
    }

    - (void)viewDidDisappear:(BOOL)animated
    {
        [super viewDidDisappear:animated];
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }

    #pragma mark - Table view data source

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
    {
    #warning Potentially incomplete method implementation.
        // Return the number of sections.
        return 1;
    }

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    {
    #warning Incomplete method implementation.
        // Return the number of rows in the section.
        return [self.tableDataSource count];
    }

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        static NSString *CellIdentifier = @"Cell";

        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {
            cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
        }
        NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];
        cell.textLabel.text = [dictionary objectForKey:@"Title"];

        return cell;

        // Configure the cell...

        return cell;
    }



    #pragma mark - Table view delegate

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {

        NSDictionary *dictionary = [self.tableDataSource objectAtIndex:indexPath.row];

        NSArray *Children = [dictionary objectForKey:@"Children"];

        if([Children count] == 0) {

            /* I want to Jump to selected page on scrollView */

        }
        else {
            ListViewController *rvController = [[ListViewController alloc] initWithStyle:UITableViewStylePlain];

            rvController.currentLevel += 1;

            rvController.currentTitle = [dictionary objectForKey:@"Title"];

            [self.navigationController pushViewController:rvController animated:YES];

            rvController.tableDataSource = Children;
        }

        // Navigation logic may go here. Create and push another view controller.
        /*
         <#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
         // ...
         // Pass the selected object to the new view controller.
         [self.navigationController pushViewController:detailViewController animated:YES];
         */
    }

    @end