热更新demo

askDetailListController.m 25KB

    // // askDetailListController.m // ThePaperDemo // // Created by scar1900 on 14/11/14. // Copyright (c) 2014年 scar1900. All rights reserved. // #import "askDetailListController.h" #import "commentActionView.h" #import "loginHomeController.h" #import "myDynamicController.h" #import "DetailAskContCell.h" #import "DetailAckIconCell.h" #import "DetailAnswerIcon.h" #import "DetailAnswerContCell.h" #import "AnswerQuoBaseCell.h" #import "AnswerPicBaseCell.h" #import "ImageShareController.h" @interface askDetailListController ()<AskIconBaseDelegate,AskContentBaseDelegate,AnswerIconBaseDelegate,AnswerContentDelegate> { NSMutableArray *tempListArray; NSString *shareListUrl; } @property(nonatomic, strong)NSMutableArray *qaDataSource; @property(nonatomic, strong)NSMutableArray *heightArray; @property(nonatomic, strong)commentActionView *commentAction; @end @implementation askDetailListController @synthesize commmentId = _commmentId; @synthesize qaDataSource = _qaDataSource; @synthesize delegate; @synthesize heightArray; @synthesize answerNums; - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. self.tableView.clipsToBounds = YES; tempListArray = [NSMutableArray array]; self.tableView.backgroundColor = [UIColor colorWithHexString:BackGroundColor]; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; [self configCanRefresh:YES canLoad:YES]; [self firstAutoRefreshHandler]; } - (void)remoteMethod:(NSString*)commentIdStr { NSDictionary *dic = @{@"commentId":commentIdStr}; [Remote doJsonAction:1 requestUrl:singleAskDetailListURL parameter:dic delegate:self]; } - (void)setCommmentId:(NSString *)idStr { _commmentId = idStr; } - (void)setQaDataSource:(NSMutableArray *)list { tempListArray = list; heightArray = [NSMutableArray array]; _qaDataSource = [NSMutableArray array]; if (!list || list.count == 0) { return; } [list enumerateObjectsUsingBlock:^(commentObjectVO *obj, NSUInteger idx, BOOL *stop) { NSDictionary *dic = setDataModelToDic(obj, [commentObjectVO class]); if (obj.type.integerValue == 2) { commentObjectVO *commentBO = setJsonDicToDataModel(dic, [commentObjectVO class]); NSString *newNums = dic[@"newNums"]; if (newNums) { commentBO.unNums = newNums; } commentBO.type = @"24"; [heightArray addObject:@"50"]; [_qaDataSource addObject:commentBO]; commentObjectVO *comment = setJsonDicToDataModel(dic, [commentObjectVO class]); comment.type = @"2"; CGFloat askHeight = 15; int LabelHeigth = (int)[TPEmojiLabel heightForLabelWithFont:appFont(TEXT_FOUR_LEVELSIZE, NO) Width:rect_screen.size.width - 20 Text:comment.content LineSpace:10 ParagraphSpacing:0]; comment.labelHeight = LabelHeigth; [_qaDataSource addObject:comment]; askHeight += LabelHeigth; [heightArray addObject:[NSString stringWithFormat:@"%f",askHeight]]; }else { commentObjectVO *answerBO = setJsonDicToDataModel(dic, [commentObjectVO class]); answerBO.type = @"34"; [heightArray addObject:@"50"]; [_qaDataSource addObject:answerBO]; commentObjectVO *answer = setJsonDicToDataModel(dic, [commentObjectVO class]); answer.type = @"3"; CGFloat anserHeight = 10; if (answer.quoteInfo && answer.quoteInfo.allKeys.count > 0) { anserHeight = 0; } int anserH = (int)[TPEmojiLabel heightForLabelWithFont:appFont(TEXT_FOUR_LEVELSIZE, NO) Width:rect_screen.size.width - 20 Text:answer.content LineSpace:10 ParagraphSpacing:0]; answer.labelHeight = anserH; [_qaDataSource addObject:answer]; CGFloat fourLine = getLineHeightWithCountAndFontWidth(4, 10, TEXT_FOUR_LEVELSIZE); if (anserH > fourLine && ![answer.isExpand isEqualToString:@"1"]) { anserH = fourLine; anserHeight += 25; } anserHeight += anserH; [heightArray addObject:[NSString stringWithFormat:@"%f",anserHeight]]; if (answer.quoteInfo && answer.quoteInfo.allKeys.count > 0) { commentObjectVO *quoInfo = setJsonDicToDataModel(answer.quoteInfo, [commentObjectVO class]); CGFloat quoHeight = 50/2+15+15; quoInfo.type = @"1"; CGFloat quoLabelHeight = (int)[TPEmojiLabel heightForLabelWithFont:appFont(TEXT_FOUR_LEVELSIZE, NO) Width:rect_screen.size.width - 20 - 16 Text:quoInfo.content LineSpace:10 ParagraphSpacing:0]; quoInfo.labelHeight = quoLabelHeight; CGFloat twoLine = getLineHeightWithCountAndFontWidth(2, 10, TEXT_FOUR_LEVELSIZE); if (quoLabelHeight > twoLine && ![quoInfo.isQuoExpand isEqualToString:@"1"]) { quoLabelHeight = twoLine; quoHeight += 15; } quoHeight += quoLabelHeight; [_qaDataSource addObject:quoInfo]; if (quoInfo.imageList.count > 0) { quoHeight += quo_pic_width+15/2; } [heightArray addObject:[NSString stringWithFormat:@"%f",quoHeight]]; } } }]; [self.tableView reloadData]; } - (commentActionView*)commentAction { if (!_commentAction) { _commentAction = [[commentActionView alloc]initWithFrame:CGRectZero]; } return _commentAction; } #pragma mark #pragma mark - tableView delegate and dataSource #pragma mark UITableViewDelegate and UITableViewDataSource - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; } - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return self.qaDataSource.count; } - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { if (heightArray.count > 0) { return [heightArray[indexPath.row] floatValue]; }else return 0.f; } - (UITableViewCell *)tableView:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)indexPath { commentObjectVO* commentObj =self.qaDataSource[indexPath.row]; switch ([commentObj.type integerValue]) { case 1://跟帖 return [self returnAnswerQuoTable:table cellForRowAtIndexPath:indexPath]; break; case 2://提问 return [self returnAskContentTable:table cellForRowAtIndexPath:indexPath]; break; case 3://回答 return [self returnAnswerContentTableTable:table cellForRowAtIndexPath:indexPath]; break; case 24://提问头像 return [self returnAskIconTable:table cellForRowAtIndexPath:indexPath]; break; case 34://回答头像 return [self returnAnswerIconTable:table cellForRowAtIndexPath:indexPath]; break; case 5://图片 return [self returnAnswerPicTable:table cellForRowAtIndexPath:indexPath]; break; default: break; } return nil; } - (DetailAskContCell *)returnAskContentTable:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)index { static NSString *cellId = @"AskContentBaseCellId"; DetailAskContCell *cell = [table dequeueReusableCellWithIdentifier:cellId]; if (nil == cell) { cell = [[DetailAskContCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; } commentObjectVO *comment = self.qaDataSource[index.row]; cell.commentBO = comment; cell.delegate = self; return cell; } - (DetailAckIconCell *)returnAskIconTable:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)index { static NSString *cellId = @"DetailAckIconCell"; DetailAckIconCell *cell = [table dequeueReusableCellWithIdentifier:cellId]; if (nil == cell) { cell = [[DetailAckIconCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; } commentObjectVO *comment = self.qaDataSource[index.row]; cell.commentBO = comment; cell.topicNumsLabel.text = [NSString stringWithFormat:@"(%@个回答)",self.answerNums]; cell.delegate = self; return cell; } - (DetailAnswerIcon *)returnAnswerIconTable:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)index { static NSString *cellId = @"AnswerIconBaseCellId"; DetailAnswerIcon *cell = [table dequeueReusableCellWithIdentifier:cellId]; if (nil == cell) { cell = [[DetailAnswerIcon alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; } commentObjectVO *comment = self.qaDataSource[index.row]; cell.commentBO = comment; cell.delegate = self; return cell; } - (DetailAnswerContCell *)returnAnswerContentTableTable:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)index { static NSString *cellId = @"AnswerContentBaseCellId"; DetailAnswerContCell *cell = [table dequeueReusableCellWithIdentifier:cellId]; if (nil == cell) { cell = [[DetailAnswerContCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; } commentObjectVO *comment = self.qaDataSource[index.row]; comment.askCommentBO = self.qaDataSource[1]; cell.commentBO = comment; cell.indexPath = index; cell.delegate = self; __block NSIndexPath *IndexPath = index; __weak typeof(self) Self = self; [cell expandCell:^(BOOL isExpand, CGFloat cellHeight) { CGFloat backY = [cell.aswerContentLabel convertRect:cell.aswerContentLabel.bounds toView:KEY_WINDOW].origin.y-64; if (isExpand) { cellHeight = cellHeight+25+10; if (cell.commentBO.quoteInfo && cell.commentBO.quoteInfo.allKeys.count > 0) { cellHeight -= 10; } [heightArray replaceObjectAtIndex:IndexPath.row withObject:[NSString stringWithFormat:@"%f",cellHeight]]; NSArray *array = @[IndexPath]; [Self.tableView beginUpdates]; [Self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationFade]; [Self.tableView endUpdates]; }else { CGFloat four = getLineHeightWithCountAndFontWidth(4, 10, TEXT_FOUR_LEVELSIZE); cellHeight = four+25+10; if (cell.commentBO.quoteInfo && cell.commentBO.quoteInfo.allKeys.count > 0) { cellHeight -= 10; } [heightArray replaceObjectAtIndex:IndexPath.row withObject:[NSString stringWithFormat:@"%f",cellHeight]]; NSArray *array = @[IndexPath]; [Self.tableView beginUpdates]; [Self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationFade]; [Self.tableView endUpdates]; } if (backY < 0) { [Self.tableView beginUpdates]; [Self.tableView scrollToRowAtIndexPath:IndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; [Self.tableView endUpdates]; } }]; return cell; } - (AnswerQuoBaseCell *)returnAnswerQuoTable:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)index { static NSString *cellId = @"AnswerQuoBaseCellId"; AnswerQuoBaseCell *cell = [table dequeueReusableCellWithIdentifier:cellId]; if (nil == cell) { cell = [[AnswerQuoBaseCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; } commentObjectVO *comment = self.qaDataSource[index.row]; cell.commentBO = comment; __block NSIndexPath *IndexPath = index; __weak typeof(self) Self = self; [cell quoBlock:^(BOOL isQuoExpand, CGFloat quoHeight) { CGFloat backY = [cell.quoContentLabel convertRect:cell.quoContentLabel.bounds toView:KEY_WINDOW].origin.y-64; if (isQuoExpand) { quoHeight = quoHeight+50/2+15+15; if (cell.commentBO.imageList.count > 0) { quoHeight += quo_pic_width+15/2; } [heightArray replaceObjectAtIndex:IndexPath.row withObject:[NSString stringWithFormat:@"%f",quoHeight]]; NSArray *array = @[IndexPath]; [Self.tableView beginUpdates]; [Self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationFade]; [Self.tableView endUpdates]; }else { CGFloat two = getLineHeightWithCountAndFontWidth(2, 10, TEXT_FOUR_LEVELSIZE); quoHeight = two+50/2+15+15+15; if (cell.commentBO.imageList.count > 0) { quoHeight += quo_pic_width+15/2; } [heightArray replaceObjectAtIndex:IndexPath.row withObject:[NSString stringWithFormat:@"%f",quoHeight]]; NSArray *array = @[IndexPath]; [Self.tableView beginUpdates]; [Self.tableView reloadRowsAtIndexPaths:array withRowAnimation:UITableViewRowAnimationFade]; [Self.tableView endUpdates]; } if (backY < 0) { [Self.tableView beginUpdates]; [Self.tableView scrollToRowAtIndexPath:IndexPath atScrollPosition:UITableViewScrollPositionMiddle animated:YES]; [Self.tableView endUpdates]; } }]; return cell; } - (AnswerPicBaseCell *)returnAnswerPicTable:(UITableView *)table cellForRowAtIndexPath:(NSIndexPath *)index { static NSString *cellId = @"AnswerPicBaseCellId"; AnswerPicBaseCell *cell = [table dequeueReusableCellWithIdentifier:cellId]; if (nil == cell) { cell = [[AnswerPicBaseCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellId]; } commentObjectVO *comment = self.qaDataSource[index.row]; cell.commentBO = comment; // cell.delegate = self; return cell; } - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { } - (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { // if (_commentAction) { // [_commentAction dismissCommentContent]; // _commentAction = nil; // } UIMenuController *menu = [UIMenuController sharedMenuController]; if (menu.menuVisible) { [menu setMenuVisible:NO animated:YES]; return; } } #pragma mark #pragma mark - TPTableView delegate - (void)pullRefreshHandler { [self remoteMethod:self.commmentId]; } - (void)pullLoadMoreHander { [Remote doJsonAction:2 requestUrl:self.nextUrl parameter:nil delegate:self]; } #pragma mark - askForNewsDelegate - (void)attentionBtnClick:(UIButton *)btn withcell:(AskIconBaseCell *)cell { commentObjectVO *comment = cell.commentBO; NSDictionary *dic = @{@"commentId":comment.commentId}; if (!btn.selected) { if (![TPUserDefault instance].userBO) { loginHomeController *vc = [loginHomeController new]; [self.navigationController pushViewController:vc animated:YES]; return; } [Remote doJsonActionWithBlock:1 requestUrl:addAttentionURL parameter:dic withWaitCursor:NO completion:^(BOOL success, NSString *message, id responseData) { if (success) { ShowMessage(@"关注成功", YES); btn.selected = !btn.selected; comment.isAttented = @"1"; cell.commentBO = comment; }else { ShowTextMessage(message); } }]; }else { if (![TPUserDefault instance].userBO) { loginHomeController *vc = [loginHomeController new]; [self.navigationController pushViewController:vc animated:YES]; return; } [Remote doJsonActionWithBlock:1 requestUrl:cancelAttentionURL parameter:dic withWaitCursor:NO completion:^(BOOL success, NSString *message, id responseData) { if (success) { ShowMessage(@"取消关注", YES); btn.selected = !btn.selected; comment.isAttented = @"0"; cell.commentBO = comment; }else { ShowTextMessage(message); } }]; } } - (void)praiseHandlerWithIndexPath:(NSIndexPath *)indexPath { NSIndexPath *index = [NSIndexPath indexPathForRow:indexPath.row-1 inSection:indexPath.section]; AnswerIconBaseCell *cell = (AnswerIconBaseCell *)[self.tableView cellForRowAtIndexPath:index]; [cell commentOK:cell.OkButton]; if (cell == nil) { commentObjectVO *obj = self.qaDataSource[index.row]; if (obj.isPraised.intValue == 1) { return; } NSDictionary *dic = @{@"commentId":obj.commentId}; [Remote doJsonActionWithBlock:2000 requestUrl:commentPraiseURL parameter:dic withWaitCursor:NO completion:^(BOOL success, NSString *message, id responseData) { if (success) { [MobClick event:@"24"]; if ([responseData[@"praiseTimes"] integerValue] < 1001) { NSString *praseNum = [NSString stringWithFormat:@"%@",responseData[@"praiseTimes"]]; obj.praiseTimes = praseNum; TPLOG(@"点赞成功"); } obj.isPraised = @"1"; TPLOG(@"点赞成功"); }else { TPLOG(@"点赞失败"); } }]; } } - (void)deleteAnswerSuccess { [self manualRefresh]; } - (void)replyBtnClick:(commentObjectVO *)comment { if ([self.delegate respondsToSelector:@selector(clickToAsk:)]) { [self.delegate clickToAsk:nil]; } } - (void)hasPraisedAnswer:(NSIndexPath *)indexPath withCommentBO:(commentObjectVO *)commentBO { // NSLog(@"%@",commentBO.userName); } - (void)gotoCommentWith:(commentObjectVO *)comment { if ([TPUserDefault instance].userBO) { [MobClick event:@"36"]; if ([self.delegate respondsToSelector:@selector(presentAskToUserContent:)]) { [self.delegate presentAskToUserContent:comment]; } }else { if ([self.delegate respondsToSelector:@selector(askPushToLoginView)]) { [self.delegate askPushToLoginView]; } } } - (void)askIconBaseGotoUserInfo:(commentObjectVO *)comment { [self gotoUserInfo:comment]; } - (void)gotoUserInfo:(commentObjectVO *)comment { if (![comment.userInfo[@"userId"] isEqualToString:[TPUserDefault instance].userBO.userId]) { myDynamicController *dynamicVC = [myDynamicController new]; dynamicVC.comment = comment; [self.navigationController pushViewController:dynamicVC animated:YES]; }else{ } } #pragma mark #pragma mark - remote delegate - (void)remoteResponsSuccess:(int)actionTag withResponsData:(id)responsData { if (actionTag == 1) { if (responsData) { if (responsData[@"objInfo"]) { objInfoBO *infoBO = setJsonDicToDataModel(responsData[@"objInfo"], [objInfoBO class]); shareListUrl = responsData[@"objInfo"][@"shareUrl"]; if ([self.delegate respondsToSelector:@selector(refreshObjInfo:)]) { [self.delegate refreshObjInfo:infoBO]; } } NSMutableArray *qaList = [NSMutableArray array]; if (responsData[@"question"]) { commentObjectVO *questionObj = setJsonDicToDataModel(responsData[@"question"], [commentObjectVO class]); //加入提问 questionObj.answerNums = self.answerNums; questionObj = setStrSpaceForParagraphSpacingWithCommentBO(questionObj); [qaList addObject:questionObj]; } if (responsData[@"answerList"]) { NSArray *answerList = responsData[@"answerList"]; if (answerList.count > 0) { [answerList enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { commentObjectVO *answerobj = setJsonDicToDataModel(obj, [commentObjectVO class]); answerobj = setStrSpaceForParagraphSpacingWithCommentBO(answerobj); [qaList addObject:answerobj]; }]; } } self.qaDataSource = qaList; if (responsData[@"recordTotal"]) { self.answerNums = responsData[@"recordTotal"]; }else { self.answerNums = @"0"; } [self endRefresh]; [self.tableView setContentOffset:CGPointMake(0, 1)]; NSString *url = responsData[@"nextUrl"]; self.nextUrl = url; } }else { NSMutableArray *qaList = [NSMutableArray arrayWithArray:tempListArray]; if (responsData[@"answerList"]) { NSArray *answerList = responsData[@"answerList"]; if (answerList.count > 0) { [answerList enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) { commentObjectVO *answerobj = setJsonDicToDataModel(obj, [commentObjectVO class]); answerobj = setStrSpaceForParagraphSpacingWithCommentBO(answerobj); [qaList addObject:answerobj]; }]; } } self.qaDataSource = [NSMutableArray arrayWithArray:qaList]; [self loadSuccess]; NSString *url = responsData[@"nextUrl"]; self.nextUrl = url; } } - (void)remoteResponsFailed:(int)actionTag withMessage:(NSString *)message resultCode:(NSString *)code { if ([code intValue] == 5) { }else { BOOL isTimeOut = NO; if ([message isEqualToString:@"请求超时,请稍后重试!"]) { isTimeOut = YES; }else { if ([message isEqualToString:@"网络连接中断,请检查网络设置!"]) { isTimeOut = YES; } ShowTextMessage(message); } [self remoteFail:isTimeOut]; } } - (void)refreshPage { [self manualRefresh]; } - (void)remoteFail:(BOOL)isTimeOut { [self endRefresh]; [self loadFailed]; if (isTimeOut) { [self networkTimeOut]; } } //网络出错 - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma mark --------- gotoshare -(void)gotoShare:(commentObjectVO *)comment index:(NSIndexPath *)index{ ImageShareController *imageShareController = [ImageShareController new]; imageShareController.backgroundColor = [UIColor colorWithHexString:BackGroundColor]; commentObjectVO *askComment = comment.askCommentBO; CGFloat topicHeight = heightForAttributeStringWithLabel(getLineSpaceAttributedString(comment.askCommentBO.contName, 3, appFont(TEXT_SIX_LEVELSIZE, NO)), 160, appFont(TEXT_SEVEN_LEVELSIZE, NO)); // if(askComment.parentInfo){ CGFloat askHeight = 5 + heightForAttributeStringWithLabel(getLineSpaceAttributedString(comment.askCommentBO.content, 6, appFont(TEXT_FIVE_LEVELSIZE, NO)), 170, appFont(TEXT_FIVE_LEVELSIZE, NO)); CGFloat answerHeight = 5 + heightForAttributeStringWithLabel(getLineSpaceAttributedString(comment.content, 6, appFont(TEXT_FIVE_LEVELSIZE, NO)), 170, appFont(TEXT_FIVE_LEVELSIZE, NO)); imageShareController.frame = CGRectMake(0, 0, 240, 340+topicHeight+askHeight+answerHeight); [imageShareController setAskData:askComment answerData:comment hostId:nil topHeight:topicHeight askHeight:askHeight answerHeight:answerHeight]; // }else{ // CGFloat askHeight = heightForAttributeStringWithLabel(getLineSpaceAttributedString(askComment.content, 6, appFont(TEXT_FIVE_LEVELSIZE, NO)), 170, appFont(TEXT_FIVE_LEVELSIZE, NO)); // imageShareController.frame = CGRectMake(0, 0, 240, 280+topicHeight+askHeight); // imageShareController.askData = comment; // } UIImage* img = [self capture:imageShareController]; if (!img) { ShowTextMessage(@"图片未完成"); return; } // UIImageWriteToSavedPhotosAlbum(img, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL); contentObjectBO *askContentBO = [contentObjectBO new]; askContentBO.name = comment.askCommentBO.contName; askContentBO.summary = comment.content; askContentBO.shareUrl = shareListUrl; if ([self.delegate respondsToSelector:@selector(askListToShare:contentBO:)]) { [self.delegate askListToShare:img contentBO:askContentBO]; } // } } - (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo { NSString *msg = nil ; // if(error != NULL){ // msg = @"保存图片失败" ; // }else{ // msg = @"已保存至相册" ; // } ShowTextMessage(msg); } - (UIImage *)capture:(ImageShareController*)view { if ([view isKindOfClass:[UIImageView class]]) { return ((UIImageView*)view).image; } UIGraphicsBeginImageContextWithOptions(view.bounds.size, view.opaque, 0.0); [view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage * img = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); return img; } /* #pragma mark - Navigation // In a storyboard-based application, you will often want to do a little preparation before navigation - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { // Get the new view controller using [segue destinationViewController]. // Pass the selected object to the new view controller. } */ @end