Skip to content

Commit d7f902d

Browse files
committed
Accept Pull Request #49 : (hbzs:no366 -> coding:master)
Pull Request: 2015-12-8 no366 Created By: @黑白之上 Accepted By: @王哼哼 URL: https://coding.net/u/coding/p/Coding-iPad/git/pull/49?tab=files&diff=split
2 parents 4f9c08d + ac787e2 commit d7f902d

28 files changed

+1699
-209
lines changed

CodingForiPad.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@
166166
3EE2120A1B8F5CB4005AD963 /* NSTimer+Common.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EE212091B8F5CB4005AD963 /* NSTimer+Common.m */; };
167167
3EFDAC0D1B80898700D7C7B6 /* COTweetDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 3EFDAC0C1B80898700D7C7B6 /* COTweetDetailCell.m */; };
168168
4066C8BA967EC44675BAEE39 /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = FA54BD397E0D98238469E4BE /* libPods.a */; };
169+
8A9D08491C0DDD3F00FFF3ED /* gif_mark@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 8A9D08481C0DDD3F00FFF3ED /* gif_mark@2x.png */; };
169170
EB0046231B54F5A700B30971 /* COUserReNameController.m in Sources */ = {isa = PBXBuildFile; fileRef = EB0046221B54F5A700B30971 /* COUserReNameController.m */; };
170171
EB0046261B54F5C700B30971 /* COUserReTagController.m in Sources */ = {isa = PBXBuildFile; fileRef = EB0046251B54F5C700B30971 /* COUserReTagController.m */; };
171172
EB0046291B54F60800B30971 /* COUserRePositionController.m in Sources */ = {isa = PBXBuildFile; fileRef = EB0046281B54F60800B30971 /* COUserRePositionController.m */; };
@@ -645,6 +646,7 @@
645646
3EE212091B8F5CB4005AD963 /* NSTimer+Common.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "NSTimer+Common.m"; sourceTree = "<group>"; };
646647
3EFDAC0B1B80898700D7C7B6 /* COTweetDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = COTweetDetailCell.h; sourceTree = "<group>"; };
647648
3EFDAC0C1B80898700D7C7B6 /* COTweetDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = COTweetDetailCell.m; sourceTree = "<group>"; };
649+
8A9D08481C0DDD3F00FFF3ED /* gif_mark@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "gif_mark@2x.png"; sourceTree = "<group>"; };
648650
A84BCA25F64E44D6DAD1DF4F /* Pods.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.debug.xcconfig; path = "Pods/Target Support Files/Pods/Pods.debug.xcconfig"; sourceTree = "<group>"; };
649651
E4C199B4F038A337F242DA4C /* Pods.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = Pods.release.xcconfig; path = "Pods/Target Support Files/Pods/Pods.release.xcconfig"; sourceTree = "<group>"; };
650652
EB0046211B54F5A700B30971 /* COUserReNameController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = COUserReNameController.h; sourceTree = "<group>"; };
@@ -1876,6 +1878,7 @@
18761878
EB96D0021B46AE370072435A /* Resource */ = {
18771879
isa = PBXGroup;
18781880
children = (
1881+
8A9D08481C0DDD3F00FFF3ED /* gif_mark@2x.png */,
18791882
EB96D0031B46AE370072435A /* AssetsPickerChecked.imageset */,
18801883
EB96D0071B46AE370072435A /* camera.imageset */,
18811884
EB96D0091B46AE370072435A /* nav_delete_btn.imageset */,
@@ -2288,6 +2291,7 @@
22882291
EB96D0611B46AE370072435A /* paizhao@2x.png in Resources */,
22892292
EB96D06D1B46AE370072435A /* xiang@2x.png in Resources */,
22902293
EB96D06A1B46AE370072435A /* X.png in Resources */,
2294+
8A9D08491C0DDD3F00FFF3ED /* gif_mark@2x.png in Resources */,
22912295
EB96D05A1B46AE370072435A /* AssetsPickerChecked@2x.png in Resources */,
22922296
EB96D0621B46AE370072435A /* shanguangdeng.png in Resources */,
22932297
FEDEFC1C1B41A48C003585D1 /* bubble.html in Resources */,
@@ -2756,6 +2760,7 @@
27562760
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
27572761
CODE_SIGN_IDENTITY = "iPhone Developer";
27582762
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
2763+
ENABLE_BITCODE = NO;
27592764
FRAMEWORK_SEARCH_PATHS = (
27602765
"$(inherited)",
27612766
"$(PROJECT_DIR)/CodingForiPad/Utility",
@@ -2788,6 +2793,7 @@
27882793
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = LaunchImage;
27892794
CODE_SIGN_IDENTITY = "iPhone Distribution";
27902795
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
2796+
ENABLE_BITCODE = NO;
27912797
FRAMEWORK_SEARCH_PATHS = (
27922798
"$(inherited)",
27932799
"$(PROJECT_DIR)/CodingForiPad/Utility",

CodingForiPad/Base.lproj/Main.storyboard

Lines changed: 1290 additions & 147 deletions
Large diffs are not rendered by default.

CodingForiPad/Manager/COSession.m

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ - (NSError *)checkLoginSuccess:(CODataResponse *)response
7373
// 二次认证
7474
NSString *msg = [response displayMsg];
7575
error = [NSError errorWithDomain:@"net.coding.ipad" code:OPErrorCodeNeedAuthCode userInfo:@{NSLocalizedDescriptionKey: msg, NSLocalizedFailureReasonErrorKey : msg}];
76+
} else if (response.msg[@"email"] || response.msg[@"j_captcha_error"]) {
77+
// 用户名密码、验证码
78+
NSString *msg = [response displayMsg];
79+
error = [NSError errorWithDomain:@"net.coding.ipad" code:response.code userInfo:@{NSLocalizedDescriptionKey: msg, NSLocalizedFailureReasonErrorKey : msg}];
7680
}
7781
}
7882
else {
@@ -155,6 +159,13 @@ - (void)userLogout
155159
[self updateUserStatus:COSessionUserStatusLogout];
156160

157161
[UIApplication sharedApplication].applicationIconBadgeNumber = 0;
162+
163+
NSArray *cookies = [[NSHTTPCookieStorage sharedHTTPCookieStorage] cookies];
164+
[cookies enumerateObjectsUsingBlock:^(NSHTTPCookie * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
165+
if ([obj.domain hasSuffix:@".coding.net"]) {
166+
[[NSHTTPCookieStorage sharedHTTPCookieStorage] deleteCookie:obj];
167+
}
168+
}];
158169
}
159170

160171
- (void)loginSuccess:(CODataResponse *)response

CodingForiPad/Models/COUser.m

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44

55
#import "COUser.h"
66

7+
#define NSUINT_BIT (CHAR_BIT * sizeof(NSUInteger))
8+
#define NSUINTROTATE(val, howmuch) ((((NSUInteger)val) << howmuch) | (((NSUInteger)val) >> (NSUINT_BIT - howmuch)))
9+
710
@implementation COUser
811

912
+ (NSDictionary *)JSONKeyPathsByPropertyKey {
@@ -65,4 +68,36 @@ - (NSString *)transformToPinyin:(NSString *)txt {
6568
return [tempString uppercaseString];
6669
}
6770

71+
- (BOOL)isEqualToCOUser:(COUser *)user
72+
{
73+
if (!user) {
74+
return NO;
75+
}
76+
return (self.userId == user.userId) &&
77+
((!self.email && !user.email) || [self.email isEqualToString:user.email]) &&
78+
((!self.avatar && !user.avatar) || [self.avatar isEqualToString:user.avatar]) &&
79+
((self.lastActivityAt - user.lastActivityAt) < 0.000001) &&
80+
((self.updatedAt - user.updatedAt) < 0.000001);
81+
}
82+
83+
- (BOOL)isEqual:(id)object
84+
{
85+
if (self == object) {
86+
return YES;
87+
}
88+
if (![object isKindOfClass:[COUser class]]) {
89+
return NO;
90+
}
91+
return [self isEqualToCOUser:(COUser *)object];
92+
}
93+
94+
- (NSUInteger)hash
95+
{
96+
return NSUINTROTATE([[NSNumber numberWithInteger:_userId] hash], NSUINT_BIT / 2) ^
97+
NSUINTROTATE([_email hash], NSUINT_BIT / 4) ^
98+
NSUINTROTATE([_avatar hash], NSUINT_BIT / 8) ^
99+
NSUINTROTATE([[NSNumber numberWithDouble:_lastActivityAt] hash], NSUINT_BIT / 16) ^
100+
NSUINTROTATE([[NSNumber numberWithDouble:_updatedAt] hash], NSUINT_BIT / 32);
101+
}
102+
68103
@end
1.47 KB
Loading

CodingForiPad/Utility/ZLPhotoLib/ZLPhotoBrowser/Views/ZLPhotoPickerBrowserPhotoScrollView.m

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#import "UIImageView+WebCache.h"
1212
#import "DACircularProgressView.h"
1313
#import "ZLPhotoPickerCommon.h"
14+
#import "SVProgressHUD.h"
1415

1516
// Private methods and properties
1617
@interface ZLPhotoPickerBrowserPhotoScrollView ()<UIActionSheetDelegate> {
@@ -97,7 +98,8 @@ - (void)longGesture:(UILongPressGestureRecognizer *)gesture
9798
- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex
9899
{
99100
if (buttonIndex == 0){
100-
UIImageWriteToSavedPhotosAlbum(_photoImageView.image, nil, nil, nil);
101+
SEL selectorToCall = @selector(imageWasSavedSuccessfully:didFinishSavingWithError:contextInfo:);
102+
UIImageWriteToSavedPhotosAlbum(_photoImageView.image, self, selectorToCall, nil);
101103
}
102104
}
103105

@@ -424,4 +426,12 @@ - (void)view:(UIView *)view doubleTapDetected:(UITouch *)touch
424426
[self handleDoubleTap:CGPointMake(touchX, touchY)];
425427
}
426428

429+
- (void) imageWasSavedSuccessfully:(UIImage *)paramImage didFinishSavingWithError:(NSError *)paramError contextInfo:(void *)paramContextInfo{
430+
if (paramError == nil){
431+
[SVProgressHUD showSuccessWithStatus:@"成功保存到相册"];
432+
} else {
433+
[SVProgressHUD showErrorWithStatus:@"保存失败"];
434+
}
435+
}
436+
427437
@end

CodingForiPad/Utility/ZLPhotoLib/ZLPhotoPicker/ViewControllers/ZLPhotoPickerAssetsViewController.m

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,14 @@ - (void)photoBrowser:(ZLPhotoPickerBrowserViewController *)photoBrowser removePh
492492
self.makeView.text = [NSString stringWithFormat:@"%ld",(unsigned long)self.selectAssets.count];
493493
}
494494

495+
#pragma mark - UIImagePickerControllerDelegate
496+
497+
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
498+
{
499+
[self dismissViewControllerAnimated:YES completion:nil];
500+
}
501+
502+
495503
#pragma mark -<Navigation Actions>
496504
#pragma mark -开启异步通知
497505
- (void)back
Lines changed: 45 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,68 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="6250" systemVersion="13F34" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="9059" systemVersion="14F1021" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES">
33
<dependencies>
4-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6244"/>
4+
<deployment identifier="iOS"/>
5+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="9049"/>
6+
<capability name="Aspect ratio constraints" minToolsVersion="5.1"/>
57
</dependencies>
68
<objects>
79
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
810
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
9-
<tableViewCell contentMode="scaleToFill" selectionStyle="default" accessoryType="disclosureIndicator" indentationWidth="10" reuseIdentifier="groupCell" rowHeight="80" id="KGk-i7-Jjw" customClass="ZLPhotoPickerGroupTableViewCell">
11+
<tableViewCell contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="groupCell" rowHeight="80" id="KGk-i7-Jjw" customClass="ZLPhotoPickerGroupTableViewCell">
1012
<rect key="frame" x="0.0" y="0.0" width="320" height="80"/>
1113
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
12-
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
13-
<rect key="frame" x="0.0" y="0.0" width="320" height="43"/>
14+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" tableViewCell="KGk-i7-Jjw" id="H2p-sc-9uM">
15+
<rect key="frame" x="0.0" y="0.0" width="320" height="79"/>
1416
<autoresizingMask key="autoresizingMask"/>
1517
<subviews>
16-
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" id="sjv-sV-1ct">
18+
<imageView userInteractionEnabled="NO" contentMode="scaleAspectFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="sjv-sV-1ct">
1719
<rect key="frame" x="5" y="5" width="70" height="70"/>
18-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
20+
<animations/>
21+
<constraints>
22+
<constraint firstAttribute="width" secondItem="sjv-sV-1ct" secondAttribute="height" multiplier="1:1" id="XAd-hp-PPR"/>
23+
</constraints>
1924
</imageView>
20-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="7fN-ha-XL2">
25+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="7fN-ha-XL2">
2126
<rect key="frame" x="83" y="41" width="229" height="21"/>
22-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
27+
<animations/>
28+
<constraints>
29+
<constraint firstAttribute="height" constant="21" id="947-Vn-UNT"/>
30+
</constraints>
2331
<fontDescription key="fontDescription" type="system" pointSize="13"/>
2432
<color key="textColor" white="0.66666666666666663" alpha="1" colorSpace="calibratedWhite"/>
2533
<nil key="highlightedColor"/>
2634
</label>
27-
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="pxg-7T-Guo">
35+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="pxg-7T-Guo">
2836
<rect key="frame" x="83" y="17" width="229" height="21"/>
29-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
37+
<animations/>
3038
<fontDescription key="fontDescription" type="system" pointSize="17"/>
31-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
39+
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
3240
<nil key="highlightedColor"/>
3341
</label>
42+
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="icon_gray_right_arrow" translatesAutoresizingMaskIntoConstraints="NO" id="brI-1N-DbQ">
43+
<rect key="frame" x="283" y="34" width="7" height="11"/>
44+
<constraints>
45+
<constraint firstAttribute="width" constant="7" id="0vi-v8-kGl"/>
46+
<constraint firstAttribute="height" constant="11" id="AlV-Rp-Scj"/>
47+
</constraints>
48+
</imageView>
3449
</subviews>
50+
<animations/>
51+
<constraints>
52+
<constraint firstAttribute="trailing" secondItem="pxg-7T-Guo" secondAttribute="trailing" constant="8" id="4bo-98-v7Z"/>
53+
<constraint firstAttribute="trailing" secondItem="brI-1N-DbQ" secondAttribute="trailing" constant="30" id="7dV-i6-tn9"/>
54+
<constraint firstItem="brI-1N-DbQ" firstAttribute="centerY" secondItem="H2p-sc-9uM" secondAttribute="centerY" id="9nJ-Ui-nhL"/>
55+
<constraint firstItem="sjv-sV-1ct" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="5" id="JAC-Tt-gJ9"/>
56+
<constraint firstItem="7fN-ha-XL2" firstAttribute="top" secondItem="pxg-7T-Guo" secondAttribute="bottom" constant="3" id="P9k-pr-8KK"/>
57+
<constraint firstItem="7fN-ha-XL2" firstAttribute="leading" secondItem="pxg-7T-Guo" secondAttribute="leading" id="Ufb-k0-1Qf"/>
58+
<constraint firstAttribute="bottom" secondItem="sjv-sV-1ct" secondAttribute="bottom" constant="4" id="dIt-5z-Ubm"/>
59+
<constraint firstItem="pxg-7T-Guo" firstAttribute="leading" secondItem="sjv-sV-1ct" secondAttribute="trailing" constant="8" id="pQi-K5-jbU"/>
60+
<constraint firstItem="7fN-ha-XL2" firstAttribute="trailing" secondItem="pxg-7T-Guo" secondAttribute="trailing" id="vY1-NC-cIF"/>
61+
<constraint firstItem="pxg-7T-Guo" firstAttribute="top" secondItem="sjv-sV-1ct" secondAttribute="top" constant="12" id="wA1-gj-xBd"/>
62+
<constraint firstItem="sjv-sV-1ct" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="5" id="yt8-YD-KXT"/>
63+
</constraints>
3564
</tableViewCellContentView>
65+
<animations/>
3666
<connections>
3767
<outlet property="groupImageView" destination="sjv-sV-1ct" id="K9S-Fw-bCA"/>
3868
<outlet property="groupNameLabel" destination="pxg-7T-Guo" id="q1k-6P-yme"/>
@@ -41,9 +71,7 @@
4171
<point key="canvasLocation" x="245" y="246"/>
4272
</tableViewCell>
4373
</objects>
44-
<simulatedMetricsContainer key="defaultSimulatedMetrics">
45-
<simulatedStatusBarMetrics key="statusBar"/>
46-
<simulatedOrientationMetrics key="orientation"/>
47-
<simulatedScreenMetrics key="destination" type="retina4"/>
48-
</simulatedMetricsContainer>
74+
<resources>
75+
<image name="icon_gray_right_arrow" width="7" height="11"/>
76+
</resources>
4977
</document>

CodingForiPad/ViewController/Base/COAddMsgController.m

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,8 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
267267

268268
// 保存原图片到相册中
269269
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
270-
UIImageWriteToSavedPhotosAlbum(originalImage, self, nil, NULL);
270+
SEL selectorToCall = @selector(imageWasSavedSuccessfully:didFinishSavingWithError:contextInfo:);
271+
UIImageWriteToSavedPhotosAlbum(originalImage, self, selectorToCall, NULL);
271272
}
272273
[picker dismissViewControllerAnimated:YES completion:nil];
273274
} else {
@@ -340,4 +341,14 @@ - (void)sendImage:(id)image
340341
}];
341342
}
342343

344+
#pragma mark - save image
345+
346+
- (void) imageWasSavedSuccessfully:(UIImage *)paramImage didFinishSavingWithError:(NSError *)paramError contextInfo:(void *)paramContextInfo{
347+
if (paramError == nil){
348+
[self showSuccess:@"成功保存到相册"];
349+
} else {
350+
[self showErrorWithStatus:@"保存失败"];
351+
}
352+
}
353+
343354
@end

CodingForiPad/ViewController/Base/COAddProjectController.m

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ - (IBAction)okBtnAction:(UIButton *)sender
175175
if ([weakself checkDataResponse:responseObject]) {
176176
[weakself showSuccess:@"项目创建成功~"];
177177
[[CORootViewController currentRoot] dismissPopover];
178-
[[NSNotificationCenter defaultCenter] postNotificationName:OPProjectReloadNotification object:nil];
178+
[[NSNotificationCenter defaultCenter] postNotificationName:OPProjectReloadNotification object:nil userInfo:@{@"data":responseObject.data}];
179179
}
180180
});
181181
} failure:^(NSError *error) {
@@ -232,12 +232,23 @@ - (void)imagePickerController:(UIImagePickerController *)picker didFinishPicking
232232

233233
// 保存原图片到相册中
234234
if (picker.sourceType == UIImagePickerControllerSourceTypeCamera) {
235-
UIImageWriteToSavedPhotosAlbum(originalImage, self, nil, NULL);
235+
SEL selectorToCall = @selector(imageWasSavedSuccessfully:didFinishSavingWithError:contextInfo:);
236+
UIImageWriteToSavedPhotosAlbum(originalImage, self, selectorToCall, NULL);
236237
}
237238
[picker dismissViewControllerAnimated:YES completion:nil];
238239
} else {
239240
NSLog(@"请在真机使用!");
240241
}
241242
}
242243

244+
#pragma mark - save image
245+
246+
- (void) imageWasSavedSuccessfully:(UIImage *)paramImage didFinishSavingWithError:(NSError *)paramError contextInfo:(void *)paramContextInfo{
247+
if (paramError == nil){
248+
[self showSuccess:@"成功保存到相册"];
249+
} else {
250+
[self showErrorWithStatus:@"保存失败"];
251+
}
252+
}
253+
243254
@end

0 commit comments

Comments
 (0)