我有一个包含几个项目的NSArray。 国家航空航天局从另一个类别装上了一张可核实的概览。 当我放弃详细的看法和重新进入(第3次)时,国家空间局是空洞的,表象也是空洞的。 正在发生什么? (我使用了弧线,因此我认为它是一种泄漏)
- (void)viewDidLoad {
myMatch = [[Match alloc] initWithId:1 OpponentId:13];
}
- (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *askCellIdent = @"askCell";
static NSString *answerCellIdent = @"answerCell";
if (indexPath.row == 0)
{
AskCell *cell = [tv dequeueReusableCellWithIdentifier:askCellIdent];
if (cell==nil) {
cell = [[AskCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:askCellIdent];
}
cell.nameLabel.text = @"Albert asked:";
cell.questionLabel.text = [NSString stringWithFormat:@"%@", [[myMatch.chat objectAtIndex:indexPath.row] objectAtIndex:1]];
return cell;
}
if (indexPath.row == 1)
{
AnswerCell *cell = [tv dequeueReusableCellWithIdentifier:answerCellIdent];
if (cell==nil) {
cell = [[AnswerCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:answerCellIdent];
}
cell.nameLabel.text = @"Hugh answered:";
cell.answerLabel.text = [NSString stringWithFormat:@"%@", [[myMatch.chat objectAtIndex:indexPath.row] objectAtIndex:1]];
return cell;
}
}
这里是我同级的随身守则:
- (id) initWithId:(NSInteger)yourId OpponentId:(NSInteger)opId {
self = [super init];
if (self != nil) {
//set your id and opponents id to the match.
[self setUserId:yourId];
[self setUserId:opId];
JSON = @"[{"opponentId":"4","chat":[["1","Does he have a beard?"],["1","No."]]}]";
//initiate the chat array.
chat = [[NSMutableArray alloc] init ];
[self loadMatch];
}
return self;
}
这里是动产/动产。
NSMutableArray *chat;
@property (nonatomic, retain) NSMutableArray *chat;
@synthesize chat;
No idea whats going on, because the slog of the array is empty too!