我希望在 ViewDidLoad 之前执行 didSelectRowAtIndexPath。
怎么做?
在 didSelectRowAtIndexPath :
[[NSUserDefaults standardUserDefaults] setObject:[[array objectAtIndex:indexPath.row + 1] objectForKey:@"gid"] forKey:@"lastGID"];
NSLog(@"lastGID (saved) = %@", [[NSUserDefaults standardUserDefaults] objectForKey:@"lastGID"]);
在 viewDidLoad :
[super viewDidLoad];
NSLog(@"%@", [[NSUserDefaults standardUserDefaults] objectForKey:@"lastGID"]);