У меня есть TableViewController с именем SecondViewController
. Имя ячейки в порядке, и все работает нормально, но когда дело доходит до загрузки подробного представления, которое в моем случае называется ArticleViewController
, оно не хочет связываться со свойствами подробного представления. В общем, если я хочу изменить метку в подробном представлении, она просто не работает.
Вот код:
SecondViewController.h
@interface SecondViewController : UITableViewController
{
NSMutableArray *json;
}
@end
SecondViewController.m
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ArticleViewController *article = [self.storyboard instantiateViewControllerWithIdentifier:@"ArticleViewController"];
NSDictionary *info = [json objectAtIndex:indexPath.row];
NSLog(@"%@",[info objectForKey:@"username"]);
[article.usernameLabel setText:[info objectForKey:@"username"]];
[self.navigationController pushViewController:article animated:YES];
}
ArticleViewController.h
#import <UIKit/UIKit.h>
@interface ArticleViewController : UIViewController
@property (weak, nonatomic) IBOutlet UILabel *usernameLabel;
@property (weak, nonatomic) IBOutlet UILabel *articleTitle;
@end
ArticleViewController.m
- синтезирующие свойства -
Я подключил метки и ArticleViewController, но метка никогда не меняется.