Browse files

improve performance

  • Loading branch information...
1 parent 834ff8a commit 7aeb34573365500e07c539cc8725508d5b4bc625 @JimLiu committed Dec 1, 2012
View
1 sample_WeiboPlus/Controllers/HomeViewController.m
@@ -68,6 +68,7 @@ - (void)viewDidLoad
{
[super viewDidLoad];
self.tableView.backgroundColor = [UIColor colorWithPatternImage:[Images textureBackgroundImage]];
+ self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
}
- (void)viewDidUnload
View
BIN sample_WeiboPlus/Resources/Images/bg-tweet-outer.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN sample_WeiboPlus/Resources/Images/bg-tweet-outer@2x.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2 sample_WeiboPlus/Views/TweetView/TweetLayer.m
@@ -20,7 +20,7 @@ - (id)init {
self.wrapped = YES;
self.rasterizationScale = [[UIScreen mainScreen] scale];
self.contentsScale = [[UIScreen mainScreen] scale];
- //self.drawsAsynchronously = YES;
+ self.drawsAsynchronously = YES;
_activeLinkBackgroundLayers = [[NSMutableArray array] retain];
}
View
6 sample_WeiboPlus/Views/TweetView/TweetViewCell.h
@@ -19,6 +19,12 @@
ImageDownloadReceiver *_retweetAuthorImageDownloadReceiver;
UIImage *_tweetAuthorImage;
UIImage *_retweetAuthorImage;
+
+ UIImage *_drawedImage;
+ BOOL _isDrawing;
+
+ CALayer *_tweetAuthorProfileImageLayer;
+ CALayer *_retweetAuthorProfileImageLayer;
}
@property (nonatomic, retain) TweetViewCellLayout *layout;
View
115 sample_WeiboPlus/Views/TweetView/TweetViewCell.m
@@ -13,15 +13,18 @@ @interface TweetViewCell() {
@property (nonatomic, retain) UIImage *tweetAuthorImage;
@property (nonatomic, retain) UIImage *retweetAuthorImage;
+@property (nonatomic, retain) UIImage *drawedImage;
@end
@implementation TweetViewCell
@synthesize layout = _layout;
+@synthesize drawedImage = _drawedImage;
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
+ contentView.backgroundColor = [UIColor whiteColor];
_downloader = [ImageDownloader profileImagesDownloader];
_tweetAuthorImageDownloadReceiver = [[ImageDownloadReceiver alloc]init];
_tweetAuthorImageDownloadReceiver.completionBlock = ^(NSData *imageData, NSString *url, NSError *error) {
@@ -33,6 +36,13 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
};
_tweetAuthorImage = nil;
_retweetAuthorImage = nil;
+
+
+ _tweetAuthorProfileImageLayer = [self profileImageLayer];
+ _retweetAuthorProfileImageLayer = [self profileImageLayer];
+ [contentView.layer addSublayer:_tweetAuthorProfileImageLayer];
+ [contentView.layer addSublayer:_retweetAuthorProfileImageLayer];
+
}
return self;
}
@@ -45,20 +55,29 @@ - (void)dealloc {
[_retweetAuthorImageDownloadReceiver release];
[_tweetAuthorImage release];
[_retweetAuthorImage release];
+ [_drawedImage release];
[super dealloc];
}
- (CALayer *)profileImageLayer {
CALayer *layer = [CALayer layer];
layer.shouldRasterize = YES;
- //layer.frame = CGRectMake(10, 10, 34, 34);
- layer.masksToBounds = YES;
+ layer.frame = CGRectMake(10, 10, 34, 34);
+ //layer.masksToBounds = YES;
layer.rasterizationScale = [[UIScreen mainScreen] scale];
layer.drawsAsynchronously = YES;
+ NSDictionary *actions = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNull null], @"contents", nil];
+ layer.actions = actions;
+ [actions release];
return layer;
}
+- (void)resetProfileImageLayers {
+ _tweetAuthorProfileImageLayer.contents = (id)[self profileHolderImage].CGImage;
+ _retweetAuthorProfileImageLayer.contents = (id)[self profileHolderImage].CGImage;
+}
+
- (void)setLayout:(TweetViewCellLayout *)layout {
if (_layout != layout) {
[_downloader removeDelegate:_tweetAuthorImageDownloadReceiver forURL:_layout.status.user.profileImageUrl];
@@ -67,8 +86,18 @@ - (void)setLayout:(TweetViewCellLayout *)layout {
}
self.tweetAuthorImage = nil;
self.retweetAuthorImage = nil;
+ _isDrawing = NO;
+ self.drawedImage = nil;
+ [self performSelectorInBackground:@selector(resetProfileImageLayers) withObject:nil];
[_layout release];
_layout = [layout retain];
+
+ [CATransaction begin];
+ [CATransaction setAnimationDuration:0];
+ _tweetAuthorProfileImageLayer.frame = _layout.tweetAuthorProfileImageRect;
+ _retweetAuthorProfileImageLayer.frame = _layout.retweetAuthorProfileImageRect;
+ [CATransaction commit];
+
[_downloader activeRequest:_layout.status.user.profileImageUrl delegate:_tweetAuthorImageDownloadReceiver];
if (_layout.status.retweetedStatus) {
[_downloader activeRequest:_layout.status.retweetedStatus.user.profileImageUrl delegate:_retweetAuthorImageDownloadReceiver];
@@ -82,9 +111,9 @@ - (void)setLayout:(TweetViewCellLayout *)layout {
- (UIImage *)processImageData:(NSData *)imageData rect:(CGRect)rect {
UIImage *image = [UIImage imageWithData:imageData];
if (image) {
- float scale = [[UIScreen mainScreen] scale];
- CGRect bounds = CGRectMake(0, 0, rect.size.width * scale, rect.size.height * scale);
- UIGraphicsBeginImageContext(bounds.size);
+ CGRect bounds = rect;
+ bounds.origin = CGPointZero;
+ UIGraphicsBeginImageContextWithOptions(bounds.size, YES, 0);
//CGContextRef c = UIGraphicsGetCurrentContext();
//CGContextScaleCTM(c, scale, scale);
@@ -102,9 +131,9 @@ - (UIImage *)profileHolderImage {
UIImage *image = [Images profilePlaceholderOverWhiteImage];
if (image) {
CGRect rect = _layout.tweetAuthorProfileImageRect;
- float scale = [[UIScreen mainScreen] scale];
- CGRect bounds = CGRectMake(0, 0, rect.size.width * scale, rect.size.height * scale);
- UIGraphicsBeginImageContext(bounds.size);
+ CGRect bounds = rect;
+ bounds.origin = CGPointZero;
+ UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
//CGContextRef c = UIGraphicsGetCurrentContext();
//CGContextScaleCTM(c, scale, scale);
@@ -119,14 +148,32 @@ - (UIImage *)profileHolderImage {
}
+- (void)displayProfileImages {
+ if (!_isDrawing) {
+ if (self.tweetAuthorImage) {
+ [_tweetAuthorProfileImageLayer performSelectorInBackground:@selector(setContents:) withObject:(id)self.tweetAuthorImage.CGImage];
+ }
+ if (self.retweetAuthorImage) {
+ [_retweetAuthorProfileImageLayer performSelectorInBackground:@selector(setContents:) withObject:(id)self.retweetAuthorImage.CGImage];
+ }
+ }
+
+}
+
- (void)processTweetAuthorImageData:(NSData *)imageData {
self.tweetAuthorImage = [self processImageData:imageData rect:_layout.tweetAuthorProfileImageRect];
- [self setNeedsDisplayInRect:_layout.tweetAuthorProfileImageRect];
+ //_tweetAuthorProfileImageLayer.contents = (id)self.tweetAuthorImage.CGImage;
+ [self displayProfileImages];
+ //self.drawedImage = nil;
+ //[self setNeedsDisplayInRect:_layout.tweetAuthorProfileImageRect];
}
- (void)processRetweetAuthorImageData:(NSData *)imageData {
self.retweetAuthorImage = [self processImageData:imageData rect:_layout.retweetAuthorProfileImageRect];
- [self setNeedsDisplayInRect:_layout.retweetAuthorProfileImageRect];
+ //_retweetAuthorProfileImageLayer.contents = (id)self.retweetAuthorImage.CGImage;
+ [self displayProfileImages];
+ //self.drawedImage = nil;
+ //[self setNeedsDisplayInRect:_layout.retweetAuthorProfileImageRect];
}
- (void)receiver:(ImageDownloadReceiver *)receiver didDownloadWithImageData:(NSData *)imageData
@@ -144,41 +191,71 @@ - (void)receiver:(ImageDownloadReceiver *)receiver didDownloadWithImageData:(NSD
}
}
-- (void)drawContentView:(CGRect)rect highlighted:(BOOL)highlighted {
- CGContextRef context = UIGraphicsGetCurrentContext();
+- (void)drawOnImage {
+ if (!_isDrawing) {
+ _isDrawing = YES;
+ UIImage *image = nil;
+ CGRect bounds = self.bounds;
+ UIGraphicsBeginImageContextWithOptions(bounds.size, YES, 0);
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ [self drawContentInContext:context];
+ image = UIGraphicsGetImageFromCurrentImageContext();
+ UIGraphicsEndImageContext();
+ self.drawedImage = image;
+ [self performSelectorOnMainThread:@selector(setNeedsDisplay) withObject:nil waitUntilDone:NO];
+ _isDrawing = NO;
+ [self displayProfileImages];
+ }
+}
+
+- (void)drawContentInContext:(CGContextRef)context {
[[Images tweetOuterBackgroundImage]drawInRect:self.bounds];
if (_layout.status.retweetedStatus) {
[[Images tweetInnerBackgroundImage] drawInRect:_layout.retweetRect];
}
CGContextSaveGState(context);
CGContextSetTextMatrix(context, CGAffineTransformIdentity);
- CGContextTranslateCTM(context, 0.0f, rect.size.height);
+ CGContextTranslateCTM(context, 0.0f, self.bounds.size.height);
CGContextScaleCTM(context, 1.0f, -1.0f);
-
+
[_layout.tweetDocument drawTextInRect:self.bounds textRect:_layout.tweetTextRect context:context];
[_layout.tweetAuthorDocument drawTextInRect:self.bounds textRect:_layout.tweetAuthorTextRect context:context];
if (_layout.status.retweetedStatus) {
[_layout.retweetDocument drawTextInRect:self.bounds textRect:_layout.retweetTextRect context:context];
[_layout.retweetAuthorDocument drawTextInRect:self.bounds textRect:_layout.retweetAuthorTextRect context:context];
}
CGContextRestoreGState(context);
-
+
CGContextSaveGState(context);
CGContextSetRGBFillColor(context, 187/255.f, 187/255.f, 187/255.f, 1.f);
NSString *timeText = [NSString stringWithFormat:@"%@%@", [_layout.status statusTimeString], [_layout.status source]];
[timeText drawInRect:_layout.tweetTimeTextRect withFont:[Fonts statusTimeFont]];
- UIImage *profileImage = self.tweetAuthorImage ? self.tweetAuthorImage : [self profileHolderImage];
- [profileImage drawInRect:_layout.tweetAuthorProfileImageRect];
+ //UIImage *profileImage = self.tweetAuthorImage ? self.tweetAuthorImage : [self profileHolderImage];
+ //[profileImage drawInRect:_layout.tweetAuthorProfileImageRect];
if (_layout.status.retweetedStatus) {
timeText = [NSString stringWithFormat:@"%@%@", [_layout.status.retweetedStatus statusTimeString], [_layout.status.retweetedStatus source]];
[timeText drawInRect:_layout.retweetTimeTextRect withFont:[Fonts statusTimeFont]];
- profileImage = self.retweetAuthorImage ? self.retweetAuthorImage : [self profileHolderImage];
- [profileImage drawInRect:_layout.retweetAuthorProfileImageRect];
+ //profileImage = self.retweetAuthorImage ? self.retweetAuthorImage : [self profileHolderImage];
+ //[profileImage drawInRect:_layout.retweetAuthorProfileImageRect];
}
CGContextRestoreGState(context);
}
+- (void)drawContentView:(CGRect)rect highlighted:(BOOL)highlighted {
+ CGContextRef context = UIGraphicsGetCurrentContext();
+ [self drawContentInContext:context];
+ /*
+ [[Images tweetOuterBackgroundImage]drawInRect:self.bounds];
+ if (self.drawedImage) {
+ [self.drawedImage drawInRect:self.bounds];
+ }
+ else {
+ [self performSelectorInBackground:@selector(drawOnImage) withObject:nil];
+ }
+ */
+}
+
@end
View
40 sample_WeiboPlus/Views/TweetView/TweetViewCell1.h
@@ -0,0 +1,40 @@
+//
+// TweetViewCell1.h
+// WeiboPlus
+//
+// Created by junmin liu on 12-11-21.
+// Copyright (c) 2012年 idfsoft. All rights reserved.
+//
+
+#import "ABTableViewCell.h"
+#import "TweetViewCellLayout.h"
+#import "ImageDownloader.h"
+#import "ImageDownloadReceiver.h"
+#import "Images.h"
+#import "TweetLayer.h"
+
+
+@interface TweetViewCell1 : ABTableViewCell {
+ TweetViewCellLayout *_layout;
+ ImageDownloader *_downloader;
+ ImageDownloadReceiver *_tweetAuthorImageDownloadReceiver;
+ ImageDownloadReceiver *_retweetAuthorImageDownloadReceiver;
+ UIImage *_tweetAuthorImage;
+ UIImage *_retweetAuthorImage;
+
+
+ CALayer *_tweetAuthorProfileImageLayer;
+ CALayer *_retweetAuthorProfileImageLayer;
+
+ TweetLayer *_tweetTextLayer;
+ TweetLayer *_retweetTextLayer;
+ TweetLayer *_tweetAuthorLayer;
+ TweetLayer *_retweetAuthorLayer;
+ CATextLayer *_tweetTimeLayer;
+ CATextLayer *_retweetTimeLayer;
+}
+
+@property (nonatomic, retain) TweetViewCellLayout *layout;
+
+
+@end
View
219 sample_WeiboPlus/Views/TweetView/TweetViewCell1.m
@@ -0,0 +1,219 @@
+//
+// TweetViewCell1.m
+// WeiboPlus
+//
+// Created by junmin liu on 12-11-21.
+// Copyright (c) 2012年 idfsoft. All rights reserved.
+//
+
+#import "TweetViewCell1.h"
+
+@interface TweetViewCell1() {
+}
+
+@property (nonatomic, retain) UIImage *tweetAuthorImage;
+@property (nonatomic, retain) UIImage *retweetAuthorImage;
+
+@end
+
+
+@implementation TweetViewCell1
+
+- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
+ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
+ if (self) {
+ _downloader = [ImageDownloader profileImagesDownloader];
+ _tweetAuthorImageDownloadReceiver = [[ImageDownloadReceiver alloc]init];
+ _tweetAuthorImageDownloadReceiver.completionBlock = ^(NSData *imageData, NSString *url, NSError *error) {
+ [self receiver:_tweetAuthorImageDownloadReceiver didDownloadWithImageData:imageData url:url error:error];
+ };
+ _retweetAuthorImageDownloadReceiver = [[ImageDownloadReceiver alloc]init];
+ _retweetAuthorImageDownloadReceiver.completionBlock = ^(NSData *imageData, NSString *url, NSError *error) {
+ [self receiver:_retweetAuthorImageDownloadReceiver didDownloadWithImageData:imageData url:url error:error];
+ };
+ _tweetAuthorImage = nil;
+ _retweetAuthorImage = nil;
+
+ _tweetAuthorProfileImageLayer = [self profileImageLayer];
+ _retweetAuthorProfileImageLayer = [self profileImageLayer];
+ [contentView.layer addSublayer:_tweetAuthorProfileImageLayer];
+ [contentView.layer addSublayer:_retweetAuthorProfileImageLayer];
+
+ _tweetTextLayer = [[[TweetLayer alloc]init] autorelease];
+ _retweetTextLayer = [[[TweetLayer alloc]init] autorelease];
+ _tweetAuthorLayer = [[[TweetLayer alloc]init] autorelease];
+ _retweetAuthorLayer = [[[TweetLayer alloc]init] autorelease];
+ _tweetTimeLayer = [self textLayer];
+ _retweetTimeLayer = [self textLayer];
+ [contentView.layer addSublayer:_tweetTextLayer];
+ [contentView.layer addSublayer:_retweetTextLayer];
+ [contentView.layer addSublayer:_tweetAuthorLayer];
+ [contentView.layer addSublayer:_retweetAuthorLayer];
+ [contentView.layer addSublayer:_tweetTimeLayer];
+ [contentView.layer addSublayer:_retweetTimeLayer];
+ }
+ return self;
+}
+
+- (void)dealloc {
+ [_layout release];
+ _tweetAuthorImageDownloadReceiver.completionBlock = nil;
+ [_tweetAuthorImageDownloadReceiver release];
+ _retweetAuthorImageDownloadReceiver.completionBlock = nil;
+ [_retweetAuthorImageDownloadReceiver release];
+ [_tweetAuthorImage release];
+ [_retweetAuthorImage release];
+
+ [super dealloc];
+}
+
+- (CALayer *)profileImageLayer {
+ CALayer *layer = [CALayer layer];
+ layer.shouldRasterize = YES;
+ layer.frame = CGRectMake(10, 10, 34, 34);
+ layer.masksToBounds = YES;
+ layer.rasterizationScale = [[UIScreen mainScreen] scale];
+ layer.drawsAsynchronously = YES;
+ return layer;
+}
+
+- (CATextLayer *)textLayer {
+ CATextLayer *layer = [CATextLayer layer];
+ layer.shouldRasterize = YES;
+ layer.wrapped = YES;
+ layer.rasterizationScale = [[UIScreen mainScreen] scale];
+ layer.contentsScale = [[UIScreen mainScreen] scale];
+ layer.drawsAsynchronously = YES;
+ layer.foregroundColor = [UIColor colorWithWhite:187/255.f alpha:1.0].CGColor;
+ layer.fontSize = 11;
+ NSDictionary *actions = [[NSDictionary alloc] initWithObjectsAndKeys:[NSNull null], @"contents", nil];
+ layer.actions = actions;
+ [actions release];
+ return layer;
+}
+
+- (void)setTweetLayers {
+ _tweetTextLayer.document = _layout.tweetDocument;
+ _retweetTextLayer.document = _layout.retweetDocument;
+ _tweetAuthorLayer.document = _layout.tweetAuthorDocument;
+ _retweetAuthorLayer.document = _layout.retweetAuthorDocument;
+ NSString *timeText = [NSString stringWithFormat:@"%@%@", [_layout.status statusTimeString], [_layout.status source]];
+ _tweetTimeLayer.string = timeText;
+ if (_layout.status.retweetedStatus) {
+ timeText = [NSString stringWithFormat:@"%@%@", [_layout.status.retweetedStatus statusTimeString], [_layout.status.retweetedStatus source]];
+ _retweetTimeLayer.string = timeText;
+ }
+}
+
+- (void)setLayout:(TweetViewCellLayout *)layout {
+ if (_layout != layout) {
+ [_downloader removeDelegate:_tweetAuthorImageDownloadReceiver forURL:_layout.status.user.profileImageUrl];
+ if (_layout.status.retweetedStatus) {
+ [_downloader removeDelegate:_retweetAuthorImageDownloadReceiver forURL:_layout.status.retweetedStatus.user.profileImageUrl];
+ }
+ self.tweetAuthorImage = nil;
+ self.retweetAuthorImage = nil;
+ _tweetAuthorProfileImageLayer.contents = (id)[self profileHolderImage].CGImage;
+ _retweetAuthorProfileImageLayer.contents = (id)[self profileHolderImage].CGImage;
+ [_layout release];
+ _layout = [layout retain];
+ [self performSelectorInBackground:@selector(setTweetLayers) withObject:nil];
+ [CATransaction begin];
+ [CATransaction setAnimationDuration:0];
+ _tweetAuthorProfileImageLayer.frame = _layout.tweetAuthorProfileImageRect;
+ _retweetAuthorProfileImageLayer.frame = _layout.retweetAuthorProfileImageRect;
+ _tweetTextLayer.frame = _layout.tweetTextRect;
+ _retweetTextLayer.frame = _layout.retweetTextRect;
+ _tweetAuthorLayer.frame = _layout.tweetAuthorTextRect;
+ _retweetAuthorLayer.frame = _layout.retweetAuthorTextRect;
+ _tweetTimeLayer.frame = _layout.tweetTimeTextRect;
+ _retweetTimeLayer.frame = _layout.retweetTimeTextRect;
+ [CATransaction commit];
+ [_downloader activeRequest:_layout.status.user.profileImageUrl delegate:_tweetAuthorImageDownloadReceiver];
+ if (_layout.status.retweetedStatus) {
+ [_downloader activeRequest:_layout.status.retweetedStatus.user.profileImageUrl delegate:_retweetAuthorImageDownloadReceiver];
+ }
+
+ [self setNeedsDisplay];
+ [self setNeedsLayout];
+ }
+}
+
+- (UIImage *)processImageData:(NSData *)imageData rect:(CGRect)rect {
+ UIImage *image = [UIImage imageWithData:imageData];
+ if (image) {
+ CGRect bounds = rect;
+ bounds.origin = CGPointZero;
+ UIGraphicsBeginImageContextWithOptions(bounds.size, YES, 0);
+ //CGContextRef c = UIGraphicsGetCurrentContext();
+ //CGContextScaleCTM(c, scale, scale);
+
+ [image drawInRect:bounds];
+ image = UIGraphicsGetImageFromCurrentImageContext();
+
+ UIGraphicsEndImageContext();
+ }
+ return image;
+}
+
+- (UIImage *)profileHolderImage {
+ static UIImage *profileHolderImage = nil;
+ if (!profileHolderImage) {
+ UIImage *image = [Images profilePlaceholderOverWhiteImage];
+ if (image) {
+ CGRect rect = _layout.tweetAuthorProfileImageRect;
+ CGRect bounds = rect;
+ bounds.origin = CGPointZero;
+ UIGraphicsBeginImageContextWithOptions(bounds.size, NO, 0);
+ //CGContextRef c = UIGraphicsGetCurrentContext();
+ //CGContextScaleCTM(c, scale, scale);
+
+ [image drawInRect:bounds];
+ profileHolderImage = [UIGraphicsGetImageFromCurrentImageContext() retain];
+
+ UIGraphicsEndImageContext();
+ }
+
+ }
+ return profileHolderImage;
+
+}
+
+- (void)processTweetAuthorImageData:(NSData *)imageData {
+ self.tweetAuthorImage = [self processImageData:imageData rect:_layout.tweetAuthorProfileImageRect];
+ _tweetAuthorProfileImageLayer.contents = (id)self.tweetAuthorImage.CGImage;
+}
+
+- (void)processRetweetAuthorImageData:(NSData *)imageData {
+ self.retweetAuthorImage = [self processImageData:imageData rect:_layout.retweetAuthorProfileImageRect];
+ _retweetAuthorProfileImageLayer.contents = (id)self.retweetAuthorImage.CGImage;
+}
+
+- (void)receiver:(ImageDownloadReceiver *)receiver didDownloadWithImageData:(NSData *)imageData
+ url:(NSString *)url error:(NSError *) error {
+
+ if (error) {
+ NSLog(@"imageDownloadFailed: %@, %@", url, [error localizedDescription]);
+ return;//
+ }
+ if (receiver == _tweetAuthorImageDownloadReceiver) {
+ [self performSelectorInBackground:@selector(processTweetAuthorImageData:) withObject:imageData];
+ }
+ else {
+ [self performSelectorInBackground:@selector(processRetweetAuthorImageData:) withObject:imageData];
+ }
+}
+
+/*
+- (void)drawContentView:(CGRect)rect highlighted:(BOOL)highlighted {
+ //CGContextRef context = UIGraphicsGetCurrentContext();
+ [[Images tweetOuterBackgroundImage]drawInRect:self.bounds];
+ if (_layout.status.retweetedStatus) {
+ [[Images tweetInnerBackgroundImage] drawInRect:_layout.retweetRect];
+ }
+
+}
+*/
+
+
+@end
View
6 sample_WeiboPlus/WeiboPlus.xcodeproj/project.pbxproj
@@ -7,6 +7,7 @@
objects = {
/* Begin PBXBuildFile section */
+ B5268BC7165D2BFA009D2721 /* TweetViewCell1.m in Sources */ = {isa = PBXBuildFile; fileRef = B5268BC6165D2BFA009D2721 /* TweetViewCell1.m */; };
B574A2A9160D61D8000866FF /* WrapedStatus.m in Sources */ = {isa = PBXBuildFile; fileRef = B574A2A8160D61D8000866FF /* WrapedStatus.m */; };
B57FB3D6162B17A9005BFFBB /* Fonts.m in Sources */ = {isa = PBXBuildFile; fileRef = B57FB3D5162B17A9005BFFBB /* Fonts.m */; };
B5B7FC9F1609AE6400A085C4 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5B7FC9E1609AE6400A085C4 /* UIKit.framework */; };
@@ -144,6 +145,8 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
+ B5268BC5165D2BFA009D2721 /* TweetViewCell1.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TweetViewCell1.h; sourceTree = "<group>"; };
+ B5268BC6165D2BFA009D2721 /* TweetViewCell1.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TweetViewCell1.m; sourceTree = "<group>"; };
B574A2A7160D61D8000866FF /* WrapedStatus.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WrapedStatus.h; sourceTree = "<group>"; };
B574A2A8160D61D8000866FF /* WrapedStatus.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = WrapedStatus.m; sourceTree = "<group>"; };
B57FB3D4162B17A9005BFFBB /* Fonts.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Fonts.h; sourceTree = "<group>"; };
@@ -800,6 +803,8 @@
B5F8271A16326B5900D3EE24 /* TweetLayer.m */,
B5F8271B16326B5900D3EE24 /* TweetLink.h */,
B5F8271C16326B5900D3EE24 /* TweetLink.m */,
+ B5268BC5165D2BFA009D2721 /* TweetViewCell1.h */,
+ B5268BC6165D2BFA009D2721 /* TweetViewCell1.m */,
B5F8272916326C3A00D3EE24 /* TweetViewCell.h */,
B5F8272A16326C3A00D3EE24 /* TweetViewCell.m */,
B5F8272116326B5900D3EE24 /* TweetViewCellLayout.h */,
@@ -993,6 +998,7 @@
B5E35FA51632F64500947A19 /* ImageDownloader.m in Sources */,
B5E35FA61632F64500947A19 /* ImageDownloadReceiver.m in Sources */,
B5E35FA71632F64500947A19 /* ImageRequest.m in Sources */,
+ B5268BC7165D2BFA009D2721 /* TweetViewCell1.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
View
3 sdk/WeiboEngine/WeiboRequest.m
@@ -128,7 +128,8 @@ - (void)failWithError:(NSError *)error {
|| [error code] == 21314
|| [error code] == 21315
|| [error code] == 21316
- || [error code] == 21317) {
+ || [error code] == 21317
+ || [error code] == 21332) {
self.sessionDidExpire = YES;
[[NSNotificationCenter defaultCenter] postNotificationName:@"authError"
object:error];

0 comments on commit 7aeb345

Please sign in to comment.