creating a control without component etc

Discussion in 'iOS Programming' started by zedzeek, Jul 24, 2012.

  1. zedzeek macrumors newbie

    Joined:
    Nov 11, 2011
    #1
  2. xStep macrumors 68000

    Joined:
    Jan 28, 2003
    Location:
    Less lost in L.A.
    #2
    Your question needs some flushing out. Are you saying you want to create a UITableView like structure without using UITableView?

    Every UI element is accessible via code. Interface Builder isn't actually required for any of it. Look up the class in the documentation, then search online for further hints if you need them.

    Here is a quicky sample hack. I'm sure some details are missing but it should lead you in the right direction.
    Code:
    CGRect someFrame = CGRectMake(0.0,0.0,100.0,100.0); // Often the frame takes up most of the window on an iPhone, so set appropriately.
    UITableView * mytv = [[UITableView alloc] initWithFrame: someFrame style: UITableViewStylePlain];
    mytv.dataSource = self; // or some other existing object.
    mytv.delegate = self; // or some other existing object.
    [someview addSubview: mytv]; // someview may likely be the view of your view controller.
    // [mytv release]; // <-- if you are using manual memory memory management instead of ARC.
    
     

Share This Page