How to display DropDown list on table ve cell in iphone sdk
<p>i want to display the dropDown list in my project on table view cell All the data coming from xml means data is dynamic (format of data: in 1st cell display date and time , in 2nd cell team1 name , and in 3re cell team2 name ) suppose consider now i n having 4 record and i want put the drop down list in 2nd and 3rd cell but problem is that when i want set the vale of any<br>
team it will effect in last records in 1st team name so can any buddy solved may problem.
following is may basic code for drop down list. for that created the DropDown View nd access it on button click
following is the .m view where i want to set the value:</p>

<pre><code>-(id)init
{

    [super init];
    table_Detail=[[UITableView alloc]initWithFrame:CGRectMake(0, 150, 320, 330) style:UITableViewStylePlain];
    table_Detail.delegate=self;
    table_Detail.dataSource=self;

    arr_Data=[[NSMutableArray alloc]initWithObjects:@"1",@"2",@"3",@"4",@"5",@"6",@"7",@"8",@"9",@"10",nil];
    //
//  dropDownView = [[DropDownView alloc] initWithArrayData:arr_Data cellHeight:30 heightTableView:200 paddingTop:-8 paddingLeft:-5 paddingRight:-10 refView:btn_click
//                                               animation:BLENDIN openAnimationDuration:2 closeAnimationDuration:2];
//  
//  dropDownView.delegate = self;




    return self;
}


// The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
/*
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization.
    }
    return self;
}
*/


// Implement loadView to create a view hierarchy programmatically, without using a nib.
- (void)loadView
{
    [super loadView];
    [self.view addSubview:table_Detail];
    [self.view addSubview:dropDownView.view];

}

#pragma mark -
#pragma mark DropDownViewDelegate

-(void)dropDownCellSelected:(NSInteger)returnIndex
{

    [btn_click setTitle:[arr_Data objectAtIndex:returnIndex] forState:UIControlStateNormal];

}   


#pragma mark -
#pragma mark Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    return [arr_Data count];;
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }


    lbl=[[UILabel alloc]initWithFrame:CGRectMake(0, 0, 200, 45)];
    lbl.text=[arr_Data objectAtIndex:indexPath.row] ;

    btn_click=[UIButton buttonWithType:UIButtonTypeRoundedRect];
    btn_click.frame=CGRectMake(200, 5, 50, 30);
    //[btn_click setTitle:@"Click" forState:UIControlStateNormal];
    [btn_click setTitle:[arr_Data objectAtIndex:0] forState:UIControlStateNormal];
     [btn_click addTarget:self action:@selector(ClickOnButton) forControlEvents:UIControlEventTouchUpInside];

    if(indexPath.row%3==0)
    {
        lbl.backgroundColor=[UIColor grayColor];
    }
    else 
    {
        lbl.backgroundColor=[UIColor brownColor];
        [cell.contentView addSubview:btn_click];
    }
    [cell.contentView addSubview:lbl];



    // Configure the cell...

    return cell;
}

-(void)ClickOnButton
{
    //[dropDownView openAnimation];
    dropDownView=[[DropDownView alloc]initWithArrayData:arr_Data cellHeight:30 heightTableView:200 paddingTop:125 paddingLeft:5 paddingRight:5 refView:btn_click animation:BLENDIN openAnimationDuration:0.5 closeAnimationDuration:0.5];
    dropDownView.delegate=self;
    [self.view addSubview:dropDownView.view];
    //i=indexPath.row;
    [dropDownView openAnimation];
}
</code></pre>

<p>Thanks &amp; Regards,
Priyanka</p>
