嗨,我试图在标签中显示来自 SQLite 的名称和电子邮件,从tableView
到下一个视图,但在我的日志消息中,我只得到名称和标签名称,标签电子邮件为空。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *MyIdentifier = @"MyCell";
UITableViewCell *cell =[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
if (cell==nil) {
cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:MyIdentifier];
}
cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
user *worddc=[Array objectAtIndex:[indexPath row]];
cell.textLabel.text = worddc.name;
profileVC *pvc =[[profileVC alloc]init];
NSLog(@"name is %@",worddc.name);
pvc.nameLbl.text=worddc.name;
NSLog(@"email is %@",worddc.email);
NSLog(@"label name is %@",pvc.nameLbl.text);
pvc.emailLbl.text=worddc.email;
NSLog(@"label email is %@",pvc.emailLbl.text);
return cell;
}
在日志消息中:
2012-12-07 17:02:28.720 loginApp[1881:c07] CONNECTION SUCCESSFUL WITH DB
2012-12-07 17:02:36.628 loginApp[1881:c07] QUERY: select email,password from login where email ='a@a.com' and password ='a'
2012-12-07 17:02:36.664 loginApp[1881:c07] QUERY: SELECT login.Name,login.id,login.Email FROM login ORDER BY login.Name ASC, login.id ASC
2012-12-07 17:02:36.667 loginApp[1881:c07] QUERY: select last_insert_rowid()
2012-12-07 17:02:38.010 loginApp[1881:c07] id 6
2012-12-07 17:02:38.011 loginApp[1881:c07] name is a
2012-12-07 17:02:38.011 loginApp[1881:c07] email is (null)
2012-12-07 17:02:38.012 loginApp[1881:c07] label name is (null)
2012-12-07 17:02:38.017 loginApp[1881:c07] label email is (null)
请问有什么帮助或建议吗?