Search Results

Search found 2 results on 1 pages for 'martol1ni'.

Page 1/1 | 1 

  • Add subview to another view

    - by Martol1ni
    With two ViewControllers, MyView 1 and MyView 2, is there possible to add a subview to MyView2 from MyView1.m? I have tried: MyView2 * screen = [[MyView2 alloc]initWithNibName:nil bundle:nil]; [screen.view addSubView:mySubView]; But my new instance of MyView 2 has no connection to the 'visible' ViewController on MyView2, right? To clarify, the ViewController that is showing, is MyView1. I want MyView1 to be able to add a subview to the MyView2 view. Thanks

    Read the article

  • I am getting duplicates in UITableView, cellForRowAtIndexPath

    - by Martol1ni
    I am getting duplicates of my array, and wrongly displayed cells in this method: Here I am initializing the array, and adding it to the tableView: NSArray *sectionsArray = [NSArray arrayWithObjects: @"Location", @"Front Post", @"Front Fixing", @"Front Footplate", @"Rear Post", @"Read Fixing", @"Rear Footplate", @"Horizontal Bracing", @"Diagonal Bracing", @"Front Beam", @"Front Lock", @"Rear Beam", @"Rear Lock", @"Guard", @"Accessories", @"Comments", @"Off load ref", @"Loc Empty", @"Loc Affected", nil]; [_tableArray setObject:sectionsArray atIndexedSubscript:2]; [_tableView reloadData]; For some weird reason there are always the 4th object that is messed up, and is either duplicated, or do not have the views from IB. Here is the cellForRowAtIndexPath: method: - (UITableViewCell *) tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell *cell; if (indexPath.section == 2) { cell = [tableView dequeueReusableCellWithIdentifier:@"EntryCell"]; cell.tag = indexPath.row; UILabel *label = (UILabel *)[cell viewWithTag:3]; [label setText:[[_tableArray objectAtIndex:2] objectAtIndex:indexPath.row]]; } return cell; } I have logged the string [[_tableArray objectAtIndex:2] objectAtIndex:indexPath.row], and it logs the right string.

    Read the article

1