Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c 如何以编程方式创建表视图?_Objective C_Xcode_Ipad_Uitableview_Orientation - Fatal编程技术网

Objective c 如何以编程方式创建表视图?

Objective c 如何以编程方式创建表视图?,objective-c,xcode,ipad,uitableview,orientation,Objective C,Xcode,Ipad,Uitableview,Orientation,我需要在我的应用程序中使用UITable View,它必须支持横向和纵向 如果我直接从Interface builder中拖动UItableview,那么如何精确控制它 如果没有,那么建议我以编程的方式做同样的事情 谢谢 Rizwan试着接受你以前的回答 - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1;//Returns the no of sections in t

我需要在我的应用程序中使用UITable View,它必须支持横向和纵向

如果我直接从Interface builder中拖动UItableview,那么如何精确控制它

如果没有,那么建议我以编程的方式做同样的事情

谢谢
Rizwan

试着接受你以前的回答
    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        return 1;//Returns the no of sections in the tableview
    }

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
        return 5;//Returns the no of rows in the tableview
    }

//This method is called everytime when a row is created.
    - (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];

        }

        // Configure the cell...
        cell.textLabel.text =@"tableview";

        return cell;

    }