PDA

View Full Version : How to slide/navigate to another uitable view




sagarshivam
Aug 2, 2011, 12:01 AM
Dear All

Using the below code, i tried making one table view containing three dif cell elements. Also 'disclosure' is embedded. Now on tapping the row or tapping the disclosure, i want to navigate to another uitable view containing cell sub-elements. How this can be done? Also back and next button is required.
plz help me. I can think of the logic but unable to implement it. Kindly help me through sample code.

Thanks
Sagar



robbieduncan
Aug 2, 2011, 04:40 AM
1) You have not posted "the below code"

2) Look at the documentation and Apple provided examples for UINavigationController.

sagarshivam
Aug 2, 2011, 10:56 PM
Hi

I tried working with UINavigation controller but problem is that I want to push the new view as sliding., but in my case it just overlaps with the previous view.
So on tapping cell content of one table, another table view come but not as sliding but as overlapping.

Meanwhile, Is it possible for a table view to divide into two parts such that, left part is list of projects in tree structure and right side contains the list of files corresponding to the projects tapped in left part. Plz guide me how to implement this.


Thanks

ViviUO
Aug 3, 2011, 01:46 AM
If I understand you correctly from your first post, you do it in the didSelectRowAtindexPath method of your table view. Allocate the new table view (or views) you want to push, first. Maybe something similar to this:

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

YourTableViewController *yourTableViewConroller = [[YourTableViewController alloc] initWithNibName:@"YourTableViewController" bundle:nil];
YourTableViewController2*yourTableViewConroller2 = [[YourTableViewController2 alloc] initWithNibName:@"YourTableViewController2" bundle:nil];
YourTableViewController3 *yourTableViewConroller3 = [[YourTableViewController3 alloc] initWithNibName:@"YourTableViewController3" bundle:nil];


if (indexPath.section == 0 && indexPath.row == 0) {
[self.navigationController pushViewController:yourTableViewController animated:YES];
} else if (indexPath.section == 1 && indexPath.row == 0) {
[self.navigationController pushViewController:yourTableViewController2 animated:YES];
} else if (indexPath.section == 2 && indePath.row == 0) {
[self.navigationController pushViewController:yourTableViewController3 animated:YES];
} else {
NSLog(@"Error");
}

}

This code assumes your main table view has 3 sections with 1 row each.

You can probably alter it to fit your needs. Of course, there is probably a more elegant way than this to achieve what you need to do.

Also, sorry for any errors. I typed this up on my 12 in PB with a Chihuaua on my lap.

EDIT: Forgot about the bundle while alloc/init 'ing the view controllers, fixed.

sagarshivam
Aug 4, 2011, 01:01 AM
Thanks a lot!! It worked. :)

Is it possible for a table view to divide into two parts such that, left part is list of projects in tree structure and right side contains the list of files corresponding to the projects tapped in left part. Plz guide me how to implement this? Will customizing the tableview work?

ViviUO
Aug 4, 2011, 01:12 AM
Thanks a lot!! It worked. :)

Is it possible for a table view to divide into two parts such that, left part is list of projects in tree structure and right side contains the list of files corresponding to the projects tapped in left part. Plz guide me how to implement this? Will customizing the tableview work?

Not on the iphone. Your best bet would be to take a look at split view controllers for the ipad.

sagarshivam
Aug 4, 2011, 03:25 AM
Thanks a lot!!
I am just trying your way.

I am done with one small application in xcode. I have access to ipad. How is it possible to install .app from xcode to ipad?

I searched over the internet and found few ways but all are too confusing.
Even I found some $99 certification.

Plz let me know how to do it without going for this certification.

Thanks

ViviUO
Aug 4, 2011, 04:41 AM
You need to be a registered developer with Apple to install on devices, which costs $99.

However you could just use the ipad simulator.

sagarshivam
Aug 5, 2011, 12:14 AM
Thanks for the info. I am just planning to go for $99 program.

Now when I am done with the GUI part of my iphone/ipad application, I want to authenticate (suer id and password), populate the tables with data from remote server and updating as well. How is is possible to connect the application with remote mysql database.

I have already made web-app that communicates with those databases but now I want to the communication between xcode app and those mysql db.

Plz help me