I am working in a iPad application. I'm using a UITableView
to create a table and insert 2 UIImageView
s in each cell. I tried to set image in both UIImageView
s, but index path values start from 0,1,2,3,4 etc...
Each UIImageView
has same image in first cell. How to fix this issue?
Example:
- (void)viewDidLoad
{
[super viewDidLoad];
// ImageArray have 5images;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return [ImageArray count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
imgView1.image = [imageArray objectAtIndex:indexPath.row];
imgView2.image = [imageArray objectAtIndex:indexPath.row];
}