Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

tableViewController help!?

how do i attach a specific url to a specific row ???

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{

    NSIndexPath *puss=[NSIndexPath indexPathForRow:0 inSection:1]  ;
    [self.webPages objectAtIndex:puss.row];
    NSURL *bam=[NSURL URLWithString:@"http://yahoo.com"];
    [segue.destinationViewController setBoo:bam
    ];

    NSIndexPath *juss=[NSIndexPath indexPathForRow:1 inSection:1]  ;
    [self.webPages objectAtIndex:juss.row];
    NSURL *bam1=[NSURL URLWithString:@"http://google.com"];
    [segue.destinationViewController setBoo:bam1
     ];

}

@end

1 Answer

What do you mean by 'row'?

It would be nice if you can give more detail about what you want to do.

If you want to pass a specific value to another view controller, you can do it this way:

YourViewController *yvc = (YourViewController *)segue.destinationViewController;
yvc.myURLs = self.webPages;