mirror of
https://github.com/wu736139669/Ash_AWord.git
synced 2026-08-05 05:55:19 +00:00
new
This commit is contained in:
+3
-3
@@ -330,11 +330,11 @@
|
|||||||
ignoreCount = "0"
|
ignoreCount = "0"
|
||||||
continueAfterRunningActions = "No"
|
continueAfterRunningActions = "No"
|
||||||
filePath = "Ash_AWord/ViewControllers/My/SetUpViewController.m"
|
filePath = "Ash_AWord/ViewControllers/My/SetUpViewController.m"
|
||||||
timestampString = "449641045.879342"
|
timestampString = "449661357.291857"
|
||||||
startingColumnNumber = "9223372036854775807"
|
startingColumnNumber = "9223372036854775807"
|
||||||
endingColumnNumber = "9223372036854775807"
|
endingColumnNumber = "9223372036854775807"
|
||||||
startingLineNumber = "80"
|
startingLineNumber = "81"
|
||||||
endingLineNumber = "80"
|
endingLineNumber = "81"
|
||||||
landmarkName = "-tableView:cellForRowAtIndexPath:"
|
landmarkName = "-tableView:cellForRowAtIndexPath:"
|
||||||
landmarkType = "5">
|
landmarkType = "5">
|
||||||
</BreakpointContent>
|
</BreakpointContent>
|
||||||
|
|||||||
@@ -26,6 +26,11 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* app store上的Apple ID
|
||||||
|
*/
|
||||||
|
#define kAppleID 957252253
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 系统版本
|
* 系统版本
|
||||||
*/
|
*/
|
||||||
@@ -68,10 +73,10 @@
|
|||||||
/**
|
/**
|
||||||
* QQ开放平台信息
|
* QQ开放平台信息
|
||||||
*/
|
*/
|
||||||
#define kQQAppId @"1104070329"
|
#define kQQAppId @"1104478314"
|
||||||
#define kQQAppSecret @"Lkk4P8GrTkcliKZo"
|
#define kQQAppSecret @"RspMp0GiZqjabMvw"
|
||||||
|
|
||||||
#define kUmengAppkey @"551958aafd98c5cc010006d8"
|
#define kUmengAppkey @"551cf898fd98c586460011d1"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 调整图片的宽度
|
* 调整图片的宽度
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<string>QQ</string>
|
<string>QQ</string>
|
||||||
<key>CFBundleURLSchemes</key>
|
<key>CFBundleURLSchemes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>QQ41CEC6B9</string>
|
<string>QQ41d5006a</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
<string>tencent</string>
|
<string>tencent</string>
|
||||||
<key>CFBundleURLSchemes</key>
|
<key>CFBundleURLSchemes</key>
|
||||||
<array>
|
<array>
|
||||||
<string>tencent1104070329</string>
|
<string>tencent1104478314</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
<dict>
|
||||||
|
|||||||
@@ -11,4 +11,5 @@
|
|||||||
@interface SetUpViewController : ViewController<UITableViewDelegate, UITableViewDataSource>
|
@interface SetUpViewController : ViewController<UITableViewDelegate, UITableViewDataSource>
|
||||||
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
@property (weak, nonatomic) IBOutlet UITableView *tableView;
|
||||||
|
|
||||||
|
+ (void)shareAppWithViewController:(UIViewController *)controller andTitle:(NSString *)title andContent:(NSString *)content andImage:(UIImage *)image andUrl:(NSString *)url;
|
||||||
@end
|
@end
|
||||||
|
|||||||
@@ -7,7 +7,8 @@
|
|||||||
//
|
//
|
||||||
|
|
||||||
#import "SetUpViewController.h"
|
#import "SetUpViewController.h"
|
||||||
|
#import "EGOCache.h"
|
||||||
|
#import "UMSocial.h"
|
||||||
@interface SetUpViewController ()
|
@interface SetUpViewController ()
|
||||||
|
|
||||||
@end
|
@end
|
||||||
@@ -109,6 +110,62 @@
|
|||||||
}
|
}
|
||||||
return cell;
|
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
|
-(void)lgout:(id)sender
|
||||||
{
|
{
|
||||||
[AWordUser sharedInstance].isLogin = NO;
|
[AWordUser sharedInstance].isLogin = NO;
|
||||||
@@ -116,10 +173,46 @@
|
|||||||
[[NSNotificationCenter defaultCenter] postNotificationName:kLogoutSuccessNotificationName object:nil];
|
[[NSNotificationCenter defaultCenter] postNotificationName:kLogoutSuccessNotificationName object:nil];
|
||||||
[self.navigationController popViewControllerAnimated:YES];
|
[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 {
|
- (void)didReceiveMemoryWarning {
|
||||||
[super didReceiveMemoryWarning];
|
[super didReceiveMemoryWarning];
|
||||||
// Dispose of any resources that can be recreated.
|
// Dispose of any resources that can be recreated.
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
pro.pFile = file;
|
pro.pFile = file;
|
||||||
pro.reqURL = @"rs/text_image/add";
|
pro.reqURL = @"rs/text_image/add";
|
||||||
pro.responesOBJ = self.class;
|
pro.responesOBJ = self.class;
|
||||||
content = [content stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
// content = [content stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
|
||||||
pro.pro = @{@"content": content,
|
pro.pro = @{@"content": content,
|
||||||
};
|
};
|
||||||
return pro;
|
return pro;
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
- (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error {
|
- (instancetype)initWithDictionary:(NSDictionary *)dictionaryValue error:(NSError **)error {
|
||||||
self = [super initWithDictionary:dictionaryValue error:error];
|
self = [super initWithDictionary:dictionaryValue error:error];
|
||||||
if (self == nil) return nil;
|
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.
|
// Store a value that needs to be determined locally upon initialization.
|
||||||
|
|
||||||
return self;
|
return self;
|
||||||
|
|||||||
Reference in New Issue
Block a user