加入黑名单

This commit is contained in:
wu736139669
2015-06-28 20:00:24 +08:00
parent 439b4e7b2f
commit 8e9561d9c5
12 changed files with 372 additions and 13 deletions
+10
View File
@@ -374,6 +374,8 @@
A9DABA3D1B3FE4B80008E30B /* TypeSelectView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9DABA3C1B3FE4B80008E30B /* TypeSelectView.xib */; };
A9DABA401B3FE6F30008E30B /* TypeSelectBgView.m in Sources */ = {isa = PBXBuildFile; fileRef = A9DABA3F1B3FE6F30008E30B /* TypeSelectBgView.m */; };
A9DABA421B3FE6FD0008E30B /* TypeSelectBgView.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9DABA411B3FE6FD0008E30B /* TypeSelectBgView.xib */; };
A9DABA461B40130A0008E30B /* BlackListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = A9DABA441B40130A0008E30B /* BlackListViewController.m */; };
A9DABA471B40130A0008E30B /* BlackListViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = A9DABA451B40130A0008E30B /* BlackListViewController.xib */; };
A9E2711B1ADB97ED000B1542 /* Default-568h.png in Resources */ = {isa = PBXBuildFile; fileRef = A9E271191ADB97ED000B1542 /* Default-568h.png */; };
A9E2711C1ADB97ED000B1542 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = A9E2711A1ADB97ED000B1542 /* Default.png */; };
A9E2711E1ADBB25C000B1542 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9E2711D1ADBB25C000B1542 /* AVFoundation.framework */; };
@@ -1022,6 +1024,9 @@
A9DABA3E1B3FE6F30008E30B /* TypeSelectBgView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypeSelectBgView.h; sourceTree = "<group>"; };
A9DABA3F1B3FE6F30008E30B /* TypeSelectBgView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TypeSelectBgView.m; sourceTree = "<group>"; };
A9DABA411B3FE6FD0008E30B /* TypeSelectBgView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = TypeSelectBgView.xib; sourceTree = "<group>"; };
A9DABA431B40130A0008E30B /* BlackListViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BlackListViewController.h; sourceTree = "<group>"; };
A9DABA441B40130A0008E30B /* BlackListViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BlackListViewController.m; sourceTree = "<group>"; };
A9DABA451B40130A0008E30B /* BlackListViewController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BlackListViewController.xib; sourceTree = "<group>"; };
A9E271191ADB97ED000B1542 /* Default-568h.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h.png"; sourceTree = "<group>"; };
A9E2711A1ADB97ED000B1542 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
A9E2711D1ADBB25C000B1542 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
@@ -1259,6 +1264,9 @@
A97B1A391B3FA80E00D538F9 /* MessageSetViewController.h */,
A97B1A3A1B3FA80E00D538F9 /* MessageSetViewController.m */,
A97B1A3B1B3FA80E00D538F9 /* MessageSetViewController.xib */,
A9DABA431B40130A0008E30B /* BlackListViewController.h */,
A9DABA441B40130A0008E30B /* BlackListViewController.m */,
A9DABA451B40130A0008E30B /* BlackListViewController.xib */,
);
path = My;
sourceTree = "<group>";
@@ -2667,6 +2675,7 @@
A9B6DFD91B201E5B0003C1BC /* share_send_highlighted@2x.png in Resources */,
A93441EE1ACA8C8F00A6B233 /* defaultUserIcon@2x.png in Resources */,
A97559AC1ACB9DF0004ADA42 /* navigationButtonRefresh@2x.png in Resources */,
A9DABA471B40130A0008E30B /* BlackListViewController.xib in Resources */,
A90BA0181AD6067F00728393 /* voice-continue-record-bg@2x.png in Resources */,
A90BA0081AD6060600728393 /* playButton@2x.png in Resources */,
A9B6DFD61B201E4E0003C1BC /* share_close@2x.png in Resources */,
@@ -2971,6 +2980,7 @@
A96862741ACCF13300DDAA6B /* PSTCollectionViewItemKey.m in Sources */,
A96862451ACCF0B400DDAA6B /* MWGridViewController.m in Sources */,
A97C54D01AC8F10F0038818A /* PropertyEntity.m in Sources */,
A9DABA461B40130A0008E30B /* BlackListViewController.m in Sources */,
A96F27F91B21C5C800DA0A66 /* PraiseUserListViewController.m in Sources */,
A93441DE1ACA311700A6B233 /* Ash_UIUtil.m in Sources */,
A9B7BD791B3C083E00C0B1D7 /* MyMessageTableViewCell.m in Sources */,
@@ -330,11 +330,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/Main/NoteViewController.m"
timestampString = "457175065.52738"
timestampString = "457181872.052846"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "87"
endingLineNumber = "87"
startingLineNumber = "88"
endingLineNumber = "88"
landmarkName = "-selectTypeBtn:"
landmarkType = "5">
</BreakpointContent>
@@ -499,5 +499,53 @@
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/My/BlackListViewController.m"
timestampString = "457185217.350383"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "54"
endingLineNumber = "54"
landmarkName = "-loadData"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/My/BlackListViewController.m"
timestampString = "457185217.350383"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "59"
endingLineNumber = "59"
landmarkName = "-loadData"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "Yes"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Ash_AWord/ViewControllers/My/BlackListViewController.m"
timestampString = "457185217.350383"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "62"
endingLineNumber = "62"
landmarkName = "-loadData"
landmarkType = "5">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
@@ -107,4 +107,22 @@
"setting.microphoneNoAuthority" = "No microphone permissions";
"setting.microphoneAuthority" = "Please open in \"Setting\"-\"Privacy\"-\"Microphone\".";
"setting.cameraNoAuthority" = "No camera permissions";
"setting.cameraAuthority" = "Please open in \"Setting\"-\"Privacy\"-\"Camera\".";
"setting.cameraAuthority" = "Please open in \"Setting\"-\"Privacy\"-\"Camera\".";
//friend
"friend.add" = "add friend";
"friend.somebodyAddWithName" = "%@ add you as a friend";
"friend.beRefusedToAdd" = "you are shameless refused by '%@'";
"friend.inputNameToSearch" = "input to find friends";
"friend.repeat" = "'%@'has been your friend!";
"friend.repeatApply" = "you have send fridend request to '%@'!";
"friend.notAddSelf" = "can't add yourself as a friend";
"friend.repeatInvite" = "%@ have sent the application to you";
"friend.somebodyInvite" = "%@ invite you as a friend";
"friend.sendApply" = "sending application...";
"friend.sendApplyFail" = "send application fails, please operate again";
"friend.sendApplySuccess" = "send successfully";
"friend.black" = "Black List";
"friend.notChatSelf" = "can't talk to yourself";
"friend.notDeleteSelf" = "can't delete self";
"friend.block" = "Move to blacklist";
@@ -108,4 +108,22 @@
"NSDateCategory.text11" = "下午hh:mm";
"NSDateCategory.text12" = "晚上hh:mm";
"NSDateCategory.text13" = "昨天HH:mm";
"NSDateCategory.text14" = "今天 %@";
"NSDateCategory.text14" = "今天 %@";
//friend
"friend.add" = "添加好友";
"friend.somebodyAddWithName" = "%@ 添加你为好友";
"friend.beRefusedToAdd" = "你被'%@'无耻的拒绝了";
"friend.inputNameToSearch" = "输入要查找的好友";
"friend.repeat" = "'%@'已经是你的好友了!";
"friend.repeatApply" = "您已向'%@'发送好友请求了!";
"friend.notAddSelf" = "不能添加自己为好友";
"friend.repeatInvite" = "%@已经给你发来了申请";
"friend.somebodyInvite" = "%@ 邀请你为好友";
"friend.sendApply" = "正在发送申请...";
"friend.sendApplyFail" = "发送申请失败,请重新操作";
"friend.sendApplySuccess" = "发送申请成功";
"friend.black" = "黑名单";
"friend.notChatSelf" = "不能跟自己聊天";
"friend.notDeleteSelf" = "不能删除自己";
"friend.block" = "加入黑名单";
@@ -31,7 +31,7 @@
#import "AppDelegate.h"
#define KPageCount 20
@interface ChatMainViewController ()<UITableViewDelegate,UITableViewDataSource,DXMessageToolBarDelegate,LocationViewDelegate,UINavigationControllerDelegate, UIImagePickerControllerDelegate,DXChatBarMoreViewDelegate,EMCallManagerDelegate,EMCDDeviceManagerDelegate,EMChatManagerDelegate,SRRefreshDelegate>
@interface ChatMainViewController ()<UITableViewDelegate,UITableViewDataSource,DXMessageToolBarDelegate,LocationViewDelegate,UINavigationControllerDelegate, UIImagePickerControllerDelegate,DXChatBarMoreViewDelegate,EMCallManagerDelegate,EMCDDeviceManagerDelegate,EMChatManagerDelegate,SRRefreshDelegate,UIActionSheetDelegate>
{
DXMessageToolBar *_chatToolBar;
NSMutableArray* _dataSource;
@@ -86,6 +86,9 @@
_messageQueue = dispatch_queue_create("easemob.com", NULL);
_isPlayingAudio = NO;
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"更多" style:UIBarButtonItemStyleDone target:self action:@selector(setBlackFriend)];
self.navigationItem.title = _otherUserName;
if (!_otherUserName) {
@@ -135,6 +138,32 @@
[self loadMoreMessages];
}
#pragma mark 加入黑名单
-(void)setBlackFriend
{
UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:NSLocalizedString(@"cancel", @"Cancel") destructiveButtonTitle:NSLocalizedString(@"friend.block", @"join the blacklist") otherButtonTitles:nil, nil];
[actionSheet showInView:[[UIApplication sharedApplication] keyWindow]];
}
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex != actionSheet.cancelButtonIndex) {
[MBProgressHUD hudWithView:self.view label:NSLocalizedString(@"wait", @"Pleae wait...")];
__weak typeof(self) weakSelf = self;
[[EaseMob sharedInstance].chatManager asyncBlockBuddy:_conversation.chatter relationship:eRelationshipBoth withCompletion:^(NSString *username, EMError *error){
[MBProgressHUD hideHUDForView:weakSelf.view animated:YES];
if (!error)
{
//由于加入黑名单成功后会刷新黑名单,所以此处不需要再更改好友列表
[MBProgressHUD errorHudWithView:self.view label:@"成功加入,可以在设置->黑名单中删除。" hidesAfter:2.0];
}
else
{
[MBProgressHUD errorHudWithView:self.view label:error.description hidesAfter:1.0];
}
} onQueue:nil];
}
}
#pragma mark - DXMessageToolBarDelegate
- (void)inputTextViewWillBeginEditing:(XHMessageTextView *)messageInputTextView{
}
@@ -51,6 +51,7 @@
_typeSelectBgView = [Ash_UIUtil instanceXibView:@"TypeSelectBgView"];
_typeSelectBgView.frame = self.view.frame;
_typeSelectBgView.hidden = YES;
[self.view addSubview:_typeSelectBgView];
_typeSelectBgView.typeIndex = _type;
[_typeSelectBgView.allBtn addTarget:self action:@selector(selectTypeBtn:) forControlEvents:UIControlEventTouchUpInside];
@@ -51,6 +51,7 @@
_typeSelectBgView = [Ash_UIUtil instanceXibView:@"TypeSelectBgView"];
_typeSelectBgView.frame = self.view.frame;
_typeSelectBgView.hidden = YES;
[self.view addSubview:_typeSelectBgView];
_typeSelectBgView.typeIndex = _type;
[_typeSelectBgView.allBtn addTarget:self action:@selector(selectTypeBtn:) forControlEvents:UIControlEventTouchUpInside];
@@ -0,0 +1,14 @@
//
// BlackListViewController.h
// Ash_AWord
//
// Created by xmfish on 15/6/28.
// Copyright (c) 2015年 ash. All rights reserved.
//
#import "ViewController.h"
#import "BaseRefreshViewController.h"
@interface BlackListViewController : BaseRefreshViewController
@property (weak, nonatomic) IBOutlet UITableView *tableView;
@end
@@ -0,0 +1,172 @@
//
// BlackListViewController.m
// Ash_AWord
//
// Created by xmfish on 15/6/28.
// Copyright (c) 2015年 ash. All rights reserved.
//
#import "BlackListViewController.h"
#import "PraiseUserListTableViewCell.h"
#import "UserViewModel.h"
#import "PersonalInfoViewController.h"
@interface BlackListViewController ()
{
NSMutableArray* _userArr;
}
@end
@implementation BlackListViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
self.navigationItem.title = @"黑名单";
[self customViewDidLoad];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.tableView reloadData];
}
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
[self.tableView.header beginRefreshing];
}
-(void)headerRereshing
{
[self loadData];
}
-(void)footerRereshing
{
[self loadData];
}
-(void)loadData
{
[[EaseMob sharedInstance].chatManager asyncFetchBlockedListWithCompletion:^(NSArray *blockedList, EMError *error) {
if (!error) {
NSMutableArray* dataArr = [[NSMutableArray alloc] initWithArray:blockedList];
NSMutableArray* uidArr = [NSMutableArray array];
for (NSString* userid in dataArr) {
[uidArr addObject:userid];
}
PropertyEntity* pro = [UserViewModel requireUserListWithUid:uidArr];
[RequireEngine requireWithProperty:pro completionBlock:^(id viewModel) {
if ([viewModel success]) {
_userArr = [NSMutableArray arrayWithArray:[(UserViewModel*)viewModel userBaseInfoArr]];
}
[self.tableView reloadData];
[self headerEndRefreshing];
} failedBlock:^(NSError *error) {
[MBProgressHUD errorHudWithView:self.view label:kNetworkErrorTips hidesAfter:1.0];
[self.tableView reloadData];
[self headerEndRefreshing];
}];
}
} onQueue:nil];
}
#pragma mark UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _userArr.count;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 50.0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 10.0;
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
return 0.01;
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
NSString* cellIdentifier = @"cellIdentifier";
PraiseUserListTableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (!cell) {
UINib* nib = nil;
nib = [UINib nibWithNibName:@"PraiseUserListTableViewCell" bundle:nil];
[tableView registerNib:nib forCellReuseIdentifier:cellIdentifier];
cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
}
UserInfoViewModel* userInfoViewModel = [_userArr objectAtIndex:indexPath.row];
[cell setUserInfoViewModel:userInfoViewModel];
return cell;
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
return YES;
}
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
UserInfoViewModel* userInfoViewModel = [_userArr objectAtIndex:indexPath.row];
[[EaseMob sharedInstance].chatManager asyncUnblockBuddy:userInfoViewModel.uid withCompletion:^(NSString *username, EMError *error) {
if (!error) {
[_userArr removeObjectAtIndex:indexPath.row];
// Delete the row from the data source.
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
} onQueue:nil];
}
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
UserInfoViewModel* userInfoViewModel = [_userArr objectAtIndex:indexPath.row];
PersonalInfoViewController* personalInfoViewController = [[PersonalInfoViewController alloc] init];
personalInfoViewController.hidesBottomBarWhenPushed = YES;
personalInfoViewController.otherUserId = userInfoViewModel.uid;
[self.navigationController pushViewController:personalInfoViewController animated:YES];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#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
@@ -0,0 +1,34 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="7702" systemVersion="14A389" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
<dependencies>
<deployment identifier="iOS"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="7701"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner" customClass="BlackListViewController">
<connections>
<outlet property="tableView" destination="Rl6-k5-1Ob" id="PN0-RJ-h3N"/>
<outlet property="view" destination="i5M-Pr-FkT" id="sfx-zR-JGt"/>
</connections>
</placeholder>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view clearsContextBeforeDrawing="NO" contentMode="scaleToFill" id="i5M-Pr-FkT">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<tableView clipsSubviews="YES" contentMode="scaleToFill" alwaysBounceVertical="YES" style="plain" separatorStyle="default" rowHeight="44" sectionHeaderHeight="22" sectionFooterHeight="22" translatesAutoresizingMaskIntoConstraints="NO" id="Rl6-k5-1Ob">
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
</tableView>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="Rl6-k5-1Ob" secondAttribute="bottom" id="62m-TQ-JQk"/>
<constraint firstAttribute="trailing" secondItem="Rl6-k5-1Ob" secondAttribute="trailing" id="Scu-Sr-2tP"/>
<constraint firstItem="Rl6-k5-1Ob" firstAttribute="leading" secondItem="i5M-Pr-FkT" secondAttribute="leading" id="rDF-gu-iXj"/>
<constraint firstItem="Rl6-k5-1Ob" firstAttribute="top" secondItem="i5M-Pr-FkT" secondAttribute="top" id="zwd-aP-GVw"/>
</constraints>
<simulatedScreenMetrics key="simulatedDestinationMetrics" type="retina4"/>
</view>
</objects>
</document>
@@ -27,7 +27,6 @@
// Do any additional setup after loading the view from its nib.
[self customViewDidLoad];
// _userArr = [NSMutableArray array];
self.navigationItem.title = @"消息列表";
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"清空列表" style:UIBarButtonItemStyleDone target:self action:@selector(clearList)];
@@ -14,6 +14,7 @@
#import "FeedbackViewController.h"
#import "LoginViewModel.h"
#import "MessageSetViewController.h"
#import "BlackListViewController.h"
@interface SetUpViewController ()<UIAlertViewDelegate>
@end
@@ -32,11 +33,11 @@
#pragma mark UITableViewDelegate
-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
return 3;
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
if (section == 0) {
if (section == 0 || section == 1) {
return 1;
}
if([AWordUser sharedInstance].isLogin && [AWordUser sharedInstance].loginType==1)
@@ -45,7 +46,7 @@
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 20.0;
return 0.01;
}
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
@@ -53,14 +54,15 @@
}
-(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section
{
if (section == 0 ) {
if (section == 0 || section == 1) {
return 10.0;
}
return 100.0;
}
-(UIView*)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section
{
if (![AWordUser sharedInstance].isLogin || section == 0) {
if (![AWordUser sharedInstance].isLogin || section == 0 || section == 1) {
return nil;
}
UIView* view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 100)];
@@ -88,7 +90,11 @@
cell.textLabel.text = @"消息设置";
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}else
}else if(indexPath.section == 1){
cell.textLabel.text = @"黑名单";
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
}
else
{
switch (indexPath.row) {
case 0:
@@ -160,6 +166,9 @@
if (indexPath.section == 0) {
[self goMessageSet];
return;
}else if (indexPath.section == 1){
[self goBlackList];
return;
}
switch (indexPath.row) {
case 0:
@@ -194,6 +203,12 @@
}
}
#pragma mark 跳到App Store评价
-(void)goBlackList
{
BlackListViewController* blackListViewController = [[BlackListViewController alloc] init];
blackListViewController.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:blackListViewController animated:YES];
}
-(void)goMessageSet
{
MessageSetViewController* messageSetViewController = [[MessageSetViewController alloc] init];