NSObject子类启动

时间:2012-05-02 18:10:13

标签: objective-c xcode properties initialization

这是我的困境: 我有一个tableview控制器,可以在选择时加载详细视图。我在详细视图中声明了一个自定义类。

Match *myMatch;

@property (nonatomic, retain) Match *myMatch;

当我从tableview加载视图时,我将匹配的值设置为pre initialized match,如下所示:(可能存在语法错误,因为我没有复制和粘贴)

Match *match = [[Match alloc] initWithMatchData:[profile.matches objectAtIndex:indexPath.row]];

[detailView setmyMatch: match];

但是当我从详细视图中访问变量myMatch时,它是null。我想我做错了什么。有关初始化myMatch对象的内容。我没有初始化它。我需要吗?

1 个答案:

答案 0 :(得分:2)

  1. setmyMatch应为setMyMatch(大写M
  2. 您需要综合myMatch
相关问题