Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
- {
- if (indexPath.row==0)
- {
- HeaderCell *cell=[tableView dequeueReusableCellWithIdentifier:@"headercell" forIndexPath:indexPath];
- objectForKey:@"profile_pic"] , @"cover_pic":[response objectForKey:@"cover_pic"], @"follow_count":[response objectForKey:@"follow_count"], @"following_count":[response objectForKey:@"following_count"] , @"user_name":[response objectForKey:@"user_name"], @"name":[response objectForKey:@"name"],};
- NSMutableDictionary *data= response;
- UITapGestureRecognizer *tapGesture = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(GalleryClicked)];
- tapGesture.numberOfTapsRequired = 1;
- [cell.img_gallery setUserInteractionEnabled:YES];
- [cell.img_gallery addGestureRecognizer:tapGesture];
- UITapGestureRecognizer *viewProfilepic = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showProfilePic)];
- viewProfilepic.numberOfTapsRequired = 1;
- [cell.img_profilepic setUserInteractionEnabled:YES];
- [cell.img_profilepic addGestureRecognizer:viewProfilepic];
- UITapGestureRecognizer *viewcoverpic = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(showCoverPic)];
- viewcoverpic.numberOfTapsRequired = 1;
- [cell.img_coverPic setUserInteractionEnabled:YES];
- [cell.img_coverPic addGestureRecognizer:viewcoverpic];
- [cell.btn_message addTarget:self action:@selector(myMessages) forControlEvents:UIControlEventTouchUpInside];
- [cell.btn_notification addTarget:self action:@selector(notifications) forControlEvents:UIControlEventTouchUpInside];
- [cell setUpHeaderCellWithData:data];
- if ([data objectForKey:@"profile_pic"])
- {
- if ([[data objectForKey:@"profile_pic"] containsString:@"http"])
- profilPicUrl=[data objectForKey:@"profile_pic"];
- else
- profilPicUrl=@"http://gleamedm.com/reb/img/fans/profile_pic/default.jpg";
- }
- if ([data objectForKey:@"cover_pic"])
- {
- if ([[data objectForKey:@"cover_pic"] containsString:@"http"])
- coverPicUrl=[data objectForKey:@"cover_pic"];
- else
- coverPicUrl=[NSString stringWithFormat:@"http://gleamedm.com/reb/img/fans/cover_pic/%@",[data objectForKey:@"cover_pic"]];
- }
- else
- coverPicUrl=@"http://gleamedm.com/reb/img/fans/cover_pic/default.jpg";
- return cell;
- }
- else
- {
- int index=(int)indexPath.row-1; // bcoz 0 is for header
- indexPath=[NSIndexPath indexPathForRow:index inSection:0];
- SinglePost *postObj = (SinglePost *)[posts objectAtIndex:index];
- if (postObj.msg_postImgStr .length >0)
- {
- MyProfileDataCell2 *cell=(MyProfileDataCell2*)[tableView dequeueReusableCellWithIdentifier:@"dataCell2" forIndexPath:indexPath];
- [cell setupCellWithPostObject:postObj];
- [cell.textView setDelegate: self];
- cell.textView.tag=index;
- UITapGestureRecognizer *tapGesture2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(Postclicked:)];
- [cell.topView setUserInteractionEnabled:YES];
- [cell.topView addGestureRecognizer:tapGesture2];
- [cell.topView setTag:index];
- [cell.btn_comment addTarget:self action:@selector(commentClicked:) forControlEvents:UIControlEventTouchUpInside];
- [cell.btn_likeUnlike addTarget:self action:@selector(likeUnlikeClicked:) forControlEvents:UIControlEventTouchUpInside];
- cell.btn_likeUnlike.tag=cell.btn_comment.tag=index;
- UITapGestureRecognizer *viewcoverpic = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(PostPictureClicked:)];
- viewcoverpic.numberOfTapsRequired = 1;
- [cell.img_messagePic setUserInteractionEnabled:YES];
- [cell.img_messagePic addGestureRecognizer:viewcoverpic];
- [cell.img_messagePic setTag:index];
- return cell;
- }
- else
- {
- DataCell1 *cell=[tableView dequeueReusableCellWithIdentifier:@"cell" forIndexPath:indexPath];
- [cell setupCellWithPostObject:postObj];
- [cell.textView setDelegate: self];
- cell.textView.tag=index;
- UITapGestureRecognizer *tapGesture2 = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(Postclicked:)];
- [cell.topView setUserInteractionEnabled:YES];
- [cell.topView addGestureRecognizer:tapGesture2];
- [cell.topView setTag:index];
- [cell.btn_comment addTarget:self action:@selector(commentClicked:) forControlEvents:UIControlEventTouchUpInside];
- [cell.btn_likeUnlike addTarget:self action:@selector(likeUnlikeClicked:) forControlEvents:UIControlEventTouchUpInside];
- cell.btn_likeUnlike.tag=cell.btn_comment.tag=index;
- return cell;
- }
- }
Add Comment
Please, Sign In to add comment