【发布时间】:2010-04-13 13:24:46
【问题描述】:
我刚刚将我正在制作的应用从导航控制器应用转换为标签栏应用。
但这似乎不再有效,我在做一些傻事吗
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:NO];
StoryDetailViewController *storyDetailViewController = [[StoryDetailViewController alloc] initWithNibName:@"DetailView" bundle:nil];
WorldCupAppDelegate *appDelegate = [UIApplication sharedApplication].delegate;
Story *aStory = [appDelegate.stories objectAtIndex:indexPath.row];
NSURL *url = [NSURL URLWithString:aStory.picture];
NSData *data = [NSData dataWithContentsOfURL:url];
UIImage *img = [[UIImage alloc] initWithData:data];
storyDetailViewController.downloadedImage = img;
storyDetailViewController.story = [appDelegate.stories objectAtIndex:indexPath.row];
[self.navigationController pushViewController:storyDetailViewController animated:NO];
NSLog(@"view controller pushed");
[StoryDetailViewController release];
}
【问题讨论】:
-
“视图控制器被推”...被打印...?和 [tableView deselectRowAtIndexPath:indexPath animated:NO];此行应该是函数的最后一行...
标签: iphone objective-c cocoa-touch uinavigationcontroller uitabbarcontroller