Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Use below code.....define alphabetarr in globally then use it in code...</p> <pre><code>- (void)viewDidLoad { alphabetarr = [[NSArray alloc] initWithObjects:@"a",@"b",@"c",@"d",@"e",@"f",@"g",@"h",@"i",@"j",@"k",@"l",@"m",@"n",@"o",@"p",@"q",@"r",@"s",@"t",@"u",@"v",@"w",@"x",@"y",@"z", nil]; CGRect frame = self.view.frame; UITableView *tableview = [[UITableView alloc] initWithFrame:frame]; tableview.backgroundColor = [UIColor cyanColor]; tableview.separatorColor = [UIColor blackColor]; tableview.delegate = self; tableview.dataSource = self; [self.view addSubview:tableview]; [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. } - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return [alphabetarr count]; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { return 30.0 ; } - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell!=nil) { cell = nil; } if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } cell.textLabel.text = [alphabetarr objectAtIndex:indexPath.row]; return cell; } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload