how to set UISwitch pointer to access switch from one uiviewcontroller another uiviewcontroller

Posted by Rkm on Stack Overflow See other posts from Stack Overflow or by Rkm
Published on 2010-12-27T07:46:51Z Indexed on 2010/12/27 7:54 UTC
Read the original article Hit count: 449

Filed under:
|

System UIViewcontroller has button event.Tap on Button fire InfoTableviewController. InfoTableview has UISwitch . How to set NSMutableArray of UIswitch pointer for System UIViewcontroller to access switch .

SystemUIviewcontroller button event

-

(IBAction) Info_Button_Clicked:(id) sender

{           

    // pushcontroller 
     Info *info = [[Info alloc]initWithNibName:@"Info" bundle:[NSBundle mainBundle]];
     [self.navigationController pushViewController:info animated:YES];
     [info release];

}

Here   for Info TableviewController

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

if ([indexPath section] == 0)
            {
                static NSString *kDisplayCell_ID = @"DisplayCellID";
                cell = [self.tableView dequeueReusableCellWithIdentifier: kDisplayCell_ID];
                if (cell == nil)
                {
                    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier: kDisplayCell_ID] autorelease];
                    cell.selectionStyle = UITableViewCellSelectionStyleNone;
                }
                else
                {
                    // the cell is being recycled, remove old embedded controls
                    UIView *viewToRemove = nil;
                    viewToRemove = [cell.contentView viewWithTag:1];
                    if (viewToRemove)
                        [viewToRemove removeFromSuperview];
                }

                cell.textLabel.text = [[self.Soundarray objectAtIndex: indexPath.row] valueForKey:@"labelKey"];

                UIControl *control = [[self.Soundarray objectAtIndex:  indexPath.row] valueForKey:@"viewKey"];
                [cell.contentView addSubview:control];
                return cell;
            }
}

© Stack Overflow or respective owner

Related posts about iphone

Related posts about uiswitch