how to add button cell.contentview not working perfect?

I have created one application in which if i select on particular row in Table View than that selected row will expand(I have implemented row onclick row expand perfectly but i have problem with [cell.contentview addsubview:] please see image i have provided) & there is some button but i can't get perfect view in table view without clicking row i can see other cell's button here is image!

my code for displaying button is here.

    -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

        static NSString *CellIdentifier = @"Cell";

        cell = [tableBusiness dequeueReusableCellWithIdentifier:CellIdentifier];
        if (cell == nil) {

            //cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:CellIdentifier] autorelease];
            cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
        //cell.textLabel.borderStyle = UITextBorderStyleNone;
        cell.textLabel.text = [NSString stringWithFormat:@"%d",indexPath.row];

        UILabel *theText = [[UILabel alloc] initWithFrame:CGRectMake(10.0,10.0, 200, 22.0)];
        theText.text = [NSString stringWithFormat:@"  Title Text %d",indexPath.row];
        [cell.contentView addSubview:theText];

        btnMenu = [UIButton buttonWithType:UIButtonTypeRoundedRect];
        btnMenu.frame = CGRectMake(80, 160, 100, 37);
        [btnMenu setTitle:@"Go to Menu" forState:UIControlStateNormal];
        [btnMenu addTarget:nil action:@selector(accessoryTypeForRowWithIndexPath:) forControlEvents:UIControlEventTouchUpInside];
        [cell.contentView addSubview:btnMenu];
        //textView.text = nil;    

        return cell;
        [btnMenu release];

        [theText release];


& i want to make button events like on clicking particular button open that clicked button product how to do that? does any have solutions please help me. i want to create like this !Here is description for the image thread.

here its link for how to expand row.?


If you want to increase the height of cell then u can try with following code

UITableView *movieListTbl;
movieListTbl.rowHeight = "Height of cell";

But remember that you delegate your tableview.

Need Your Help

Order in mysql query

mysql order

I would just like to ask about a problem that I have with my query/queries. For example I have the following result from a query which is a union of 4 queries:

print in new terminal window

python linux osx terminal

i wrote an script that have multiple threads and in this threads i used "print()" code to print log activity about that thread, but the problem is i don't want to print all these logs at one terminal

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.