Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- {
- return 1;
- }
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- {
- return exampleArray.count;
- }
- -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- return 50;
- }
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- UITableViewCell *cell = [exampleTableView dequeueReusableCellWithIdentifier:@"cell"];
- if (cell == nil)
- {
- cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"CellWithSwitch"];
- cell.selectionStyle = UITableViewCellSelectionStyleNone;
- cell.textLabel.font = [UIFont systemFontOfSize:14];
- }
- cell.textLabel.text = [exampleArray objectAtIndex:indexPath.row];
- }
- -(IBAction)exampleButtonAction:(id)sender
- {
- exampleArray=[[NSMutableArray alloc]initWithObjects:@"example1",@"example2",@"example3",@"example4",nil];
- [exampleTableView reloadData];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement