First add Framework -> QuartzCore.framework to your project
then import header file in your ViewController.m
file
#import <QuartzCore/CALayer.h>
Add following code in your cellForRowAtIndexPath
method:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *cellIdentifier = @"TableViewCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
// Rounded Rect for cell image
CALayer *cellImageLayer = cell.imageView.layer;
[cellImageLayer setCornerRadius:9];
[cellImageLayer setMasksToBounds:YES];
}
cell.imageView.image = [UIImage imageNamed:@"image_name.png"];
return cell;
}