Hello friends please solve my problem
I have two xib , one xib has textfield and other has tableview that contain data from sqlite.
when i click on cell of tableview its store the data into string object and that string object used in .m file that contain textfield.
but textfield not shown text ..
i check all the things like text color ,background etc etc ...but still there are problem..
i assign simple text like
nametextfield.text=@"hello";
But this above code is also didn't work .
my real coding in my apps is here:
//tableviewcontroller.m
-(UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil)
{
cell = [[UITableViewCell alloc]
initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier];
}
cell.textLabel.text=[[data objectAtIndex:indexPath.row] valueForKey:@
"name"];
cell.detailTextLabel.text=[[data objectAtIndex:indexPath.row]
valueForKey:@"salary"];
return cell;
}
- (void)tableView:(UITableView *)tableView
didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ViewController *vc=[[ViewController alloc]init];
nameStr =[[data objectAtIndex:indexPath.row] valueForKey:@"name"];
salaryStr=[[data objectAtIndex:indexPath.row] valueForKey:@"salary"];
NSLog(@"%@ %@",nameStr,salaryStr); //i got the value here
[vc fillTextfield:nameStr:salaryStr];
[self.navigationController popToRootViewControllerAnimated:YES];
}
//viewcontroller.m
-(void)fillTextfield:(NSString*)nm:(NSString*)sal
{
NSLog(@"string : %@ %@ ",nm,sal);// i also got the value here
name.text=nm;
salary.text=sal;
//but after this code textfield not shown the text ... :(
}
What should i do ??????