Skip to content

Instantly share code, notes, and snippets.

@exclusiveTanim
Created November 30, 2018 21:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save exclusiveTanim/aea707e8f639d96d5a8eee17d1ab7954 to your computer and use it in GitHub Desktop.
Save exclusiveTanim/aea707e8f639d96d5a8eee17d1ab7954 to your computer and use it in GitHub Desktop.
যারা যারা ডাটাবেজে ইন্সার্ট করেছেন এখন ডাটা আন্তে পারছে না
#import "HomeViewController.h"
#import "dboperation.h"
#import "TableViewCell.h"
@interface HomeViewController ()
@end
@implementation HomeViewController
NSMutableArray *names; //এ ARRAY তে নাম গুলো থাকবে
- (void)viewDidLoad {
[super viewDidLoad];
//নিচের কোড দিয়ে কুয়েরি করা হয়েছে সব ডাটা আনার জন্য
NSString *selectSQL = @"select * from student_info";
dboperation *dop = [[dboperation alloc]init];
NSMutableArray *cuntVal = [[NSMutableArray alloc]init];
cuntVal = [dop getstudentinfo:selectSQL];
NSLog(@"Full %@",cuntVal);
names=[cuntVal valueForKey:@"firstName"];
NSLog(@"The names are %@",names);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
return names.count;
}
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
static NSString *identifier=@"TableCell";
TableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:identifier forIndexPath:indexPath];
NSInteger row=[indexPath row];
cell.lab.text=names[row];
return cell;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment