diff --git a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index ebd7af2..a368c03 100644 --- a/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Ash_AWord.xcworkspace/xcuserdata/xmfish.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -330,11 +330,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Ash_AWord/ViewControllers/My/SetUpViewController.m" - timestampString = "449641045.879342" + timestampString = "449661357.291857" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "80" - endingLineNumber = "80" + startingLineNumber = "81" + endingLineNumber = "81" landmarkName = "-tableView:cellForRowAtIndexPath:" landmarkType = "5"> diff --git a/Ash_AWord/Config/Common.h b/Ash_AWord/Config/Common.h index e0a59ad..cb21d51 100644 --- a/Ash_AWord/Config/Common.h +++ b/Ash_AWord/Config/Common.h @@ -26,6 +26,11 @@ #endif +/** + * app store上的Apple ID + */ +#define kAppleID 957252253 + /** * 系统版本 */ @@ -68,10 +73,10 @@ /** * QQ开放平台信息 */ -#define kQQAppId @"1104070329" -#define kQQAppSecret @"Lkk4P8GrTkcliKZo" +#define kQQAppId @"1104478314" +#define kQQAppSecret @"RspMp0GiZqjabMvw" -#define kUmengAppkey @"551958aafd98c5cc010006d8" +#define kUmengAppkey @"551cf898fd98c586460011d1" /** * 调整图片的宽度 diff --git a/Ash_AWord/Info.plist b/Ash_AWord/Info.plist index 578d637..1bb4ef3 100644 --- a/Ash_AWord/Info.plist +++ b/Ash_AWord/Info.plist @@ -32,7 +32,7 @@ QQ CFBundleURLSchemes - QQ41CEC6B9 + QQ41d5006a @@ -40,7 +40,7 @@ tencent CFBundleURLSchemes - tencent1104070329 + tencent1104478314 diff --git a/Ash_AWord/ViewControllers/My/SetUpViewController.h b/Ash_AWord/ViewControllers/My/SetUpViewController.h index 3027e1f..94fcbca 100644 --- a/Ash_AWord/ViewControllers/My/SetUpViewController.h +++ b/Ash_AWord/ViewControllers/My/SetUpViewController.h @@ -11,4 +11,5 @@ @interface SetUpViewController : ViewController @property (weak, nonatomic) IBOutlet UITableView *tableView; ++ (void)shareAppWithViewController:(UIViewController *)controller andTitle:(NSString *)title andContent:(NSString *)content andImage:(UIImage *)image andUrl:(NSString *)url; @end diff --git a/Ash_AWord/ViewControllers/My/SetUpViewController.m b/Ash_AWord/ViewControllers/My/SetUpViewController.m index eb1130f..f11d4b5 100644 --- a/Ash_AWord/ViewControllers/My/SetUpViewController.m +++ b/Ash_AWord/ViewControllers/My/SetUpViewController.m @@ -7,7 +7,8 @@ // #import "SetUpViewController.h" - +#import "EGOCache.h" +#import "UMSocial.h" @interface SetUpViewController () @end @@ -109,6 +110,62 @@ } return cell; } +-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath +{ + [tableView deselectRowAtIndexPath:indexPath animated:YES]; + switch (indexPath.row) { + case 0: + [self cleanCache]; + break; + case 1: + { + [SetUpViewController shareAppWithViewController:self andTitle:@"听说" andContent:@"最真的表白,是我欲言又止的沉默" andImage:[UIImage imageNamed:@"Icon@2x"] andUrl:@"http://www.baidu.com"]; + } + break; + case 4: + [self goToAppraisal]; + break; + + default: + break; + } +} +#pragma mark 跳到App Store评价 +- (void)goToAppraisal +{ + NSString *str = [NSString stringWithFormat:@"http://itunes.apple.com/us/app/id%d", kAppleID]; + [[UIApplication sharedApplication] openURL:[NSURL URLWithString:str]]; +} +#pragma mark 关于 +-(void)showAbout +{ + +} +#pragma mark 清除缓存 +- (void)cleanCache{ + [MBProgressHUD hudWithView:nil label:@"清除缓存中"]; + + //清除cookies + NSHTTPCookie *cookie; + NSHTTPCookieStorage *storage = [NSHTTPCookieStorage sharedHTTPCookieStorage]; + for (cookie in [storage cookies]) + { + [storage deleteCookie:cookie]; + } + + //清除UIWebView的缓存 + [[NSURLCache sharedURLCache] removeAllCachedResponses]; + [[EGOCache globalCache] clearCache]; + + //image缓存 + SDImageCache *cache = [SDImageCache sharedImageCache]; + [cache clearDiskOnCompletion:^{ + [self.tableView reloadData]; + [MBProgressHUD hideAllHUDsForView:nil animated:YES]; + [MBProgressHUD checkHudWithView:nil label:@"缓存清除成功" hidesAfter:1]; + }]; + +} -(void)lgout:(id)sender { [AWordUser sharedInstance].isLogin = NO; @@ -116,10 +173,46 @@ [[NSNotificationCenter defaultCenter] postNotificationName:kLogoutSuccessNotificationName object:nil]; [self.navigationController popViewControllerAnimated:YES]; } --(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath + ++ (void)shareAppWithViewController:(UIViewController *)controller andTitle:(NSString *)title andContent:(NSString *)content andImage:(UIImage *)image andUrl:(NSString *)url { - [tableView deselectRowAtIndexPath:indexPath animated:YES]; + if(title.length <= 0) + { + title = @"听说"; + } + if(content.length <= 0) + { + content = @"http://www.baidu.com"; + } + + NSString *shareText = [NSString stringWithFormat:@"%@%@",content,url]; + if(!image) + { + image = [UIImage imageNamed:@"Icon@2x"]; + } + + //设置title + [UMSocialData defaultData].extConfig.title = [NSString stringWithFormat:@"%@",title]; + //设置url链接 + [UMSocialData defaultData].extConfig.qqData.url = url; + [UMSocialData defaultData].extConfig.wechatSessionData.url = url; + [UMSocialData defaultData].extConfig.wechatTimelineData.url = url; + + //调用快速分享接口 + [UMSocialSnsService presentSnsIconSheetView:controller + appKey:kUmengAppkey + shareText:shareText + shareImage:image + shareToSnsNames:[NSArray arrayWithObjects:UMShareToSina, + UMShareToQQ, + UMShareToWechatSession, + UMShareToWechatTimeline, + UMShareToEmail, + UMShareToSms, + nil] + delegate:nil]; } + - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. diff --git a/Ash_AWord/ViewModels/Note/NotePublishViewModel.m b/Ash_AWord/ViewModels/Note/NotePublishViewModel.m index 638bb73..d78865d 100644 --- a/Ash_AWord/ViewModels/Note/NotePublishViewModel.m +++ b/Ash_AWord/ViewModels/Note/NotePublishViewModel.m @@ -21,7 +21,7 @@ pro.pFile = file; pro.reqURL = @"rs/text_image/add"; pro.responesOBJ = self.class; - content = [content stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; +// content = [content stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; pro.pro = @{@"content": content, }; return pro; diff --git a/Ash_AWord/ViewModels/Note/NoteViewModel.m b/Ash_AWord/ViewModels/Note/NoteViewModel.m index 449cf66..b021efd 100644 --- a/Ash_AWord/ViewModels/Note/NoteViewModel.m +++ b/Ash_AWord/ViewModels/Note/NoteViewModel.m @@ -25,7 +25,7 @@ - (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error { self = [super initWithDictionary:dictionaryValue error:error]; if (self == nil) return nil; - self.content = [self.content stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; +// self.content = [self.content stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; // Store a value that needs to be determined locally upon initialization. return self;