#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2012
    Posts
    10
    Rep Power
    0

    Add User input into UITableView


    I want get tableView value from the user.
    I used UITextField for get value from user.
    Please give me Source code for this.
    Thank You.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2011
    Location
    India
    Posts
    35
    Rep Power
    4
    Try with this...


    NSMutableArray *Array = [[NSMutableArray alloc] init];

    -(void)txtFieldreturn
    {
    [Array addObject:[NSString stringWithFormat:@"%g",[txtField1.text floatValue]]];
    [tableView1 reloadData];
    }



    - (NSInteger)tableViewUITableView *)tableView numberOfRowsInSectionNSInteger)section
    {
    return [container count];
    }


    - (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath
    {
    static NSString *cellIdentifier=@"cell";
    cell=[tableView1 dequeueReusableCellWithIdentifier:cellIdentifier];

    if(cell==nil)
    {
    cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefaultreuseIdentifier:cellIdentifier];
    }
    if(tableView==self.tableView1)
    {
    cell.textLabel.text=[Array objectAtIndex:indexPath.row];
    }
    cell.textLabel.font=[UIFont boldSystemFontOfSize:14];
    return cell;

    }

    PS:- Please consider : & ( together where the sad smiley shows.
  4. #3
  5. No Profile Picture
    Permanently Banned
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2012
    Posts
    12
    Rep Power
    0
    you can use either UITextField or UITextView for getting input text.

IMN logo majestic logo threadwatch logo seochat tools logo