Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix small bug

  • Loading branch information...
commit 468ad245df4fc3f1a532a8a852b808385b3a4fec 1 parent a02f45f
@hikui authored
View
BIN  ...hareClient_iOS.xcodeproj/project.xcworkspace/xcuserdata/hikui.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown
View
6 ...reClient_iOS/PicShareClient_iOS.xcodeproj/xcuserdata/hikui.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist
@@ -359,11 +359,11 @@
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "PicShareClient_iOS/BoardDetailViewController.m"
- timestampString = "355483432.964923"
+ timestampString = "355765033.925634"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
- startingLineNumber = "165"
- endingLineNumber = "165"
+ startingLineNumber = "164"
+ endingLineNumber = "164"
landmarkName = "@implementation BoardDetailViewController"
landmarkType = "3">
</FileBreakpoint>
View
12 PicShareClient_iOS/PicShareClient_iOS/BoardDetailViewController.m
@@ -127,12 +127,11 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
[imgView4 addTarget:self action:@selector(picOnTouch:) forControlEvents:UIControlEventTouchUpInside];
cell.selectedBackgroundView.backgroundColor = [UIColor whiteColor];
}else {
- do {
- UIView *tmpView = [cell.contentView viewWithTag:FIRST_IMGVIEW_TAG];
- if ([tmpView isKindOfClass:[PSThumbnailImageView class]]) {
- imgView1 = (PSThumbnailImageView *) tmpView;
- }
- } while (imgView1 == nil);
+
+ UIView *tmpView = [cell.contentView viewWithTag:FIRST_IMGVIEW_TAG];
+ if ([tmpView isKindOfClass:[PSThumbnailImageView class]]) {
+ imgView1 = (PSThumbnailImageView *) tmpView;
+ }
imgView1 = (PSThumbnailImageView *)[cell.contentView viewWithTag:FIRST_IMGVIEW_TAG];
imgView2 = (PSThumbnailImageView *)[cell.contentView viewWithTag:SECOND_IMGVIEW_TAG];
imgView3 = (PSThumbnailImageView *)[cell.contentView viewWithTag:THIRD_IMGVIEW_TAG];
@@ -224,6 +223,7 @@ - (IBAction)avatarButtonOnTouch:(id)sender
{
UserDetailViewController *udvc = [[UserDetailViewController alloc]initWithUser:self.board.owner];
[self.navigationController pushViewController:udvc animated:YES];
+ [udvc release];
}
- (IBAction)followButtonOnTouch:(id)sender
{
View
2  PicShareClient_iOS/PicShareClient_iOS/BoardInfoEditorViewController.m
@@ -49,7 +49,7 @@ - (void)viewDidLoad
}else if(type==UPDATE){
self.boardNameTF.text = self.board.name;
}
- UIBarButtonItem *rightItem;
+ UIBarButtonItem *rightItem = nil;
if (type==CREATE) {
rightItem = [[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemDone target:self action:@selector(createToServer)];
self.title = @"新建相册";
View
1  PicShareClient_iOS/PicShareClient_iOS/BoardPickerViewController.m
@@ -139,6 +139,7 @@ - (void)addButtonOnTouch
BoardInfoEditorViewController *bivec = [[BoardInfoEditorViewController alloc]initWithNibName:@"BoardInfoEditorViewController" bundle:nil];
bivec.type = CREATE;
[self.navigationController pushViewController:bivec animated:YES];
+ [bivec release];
}
- (void)setBoardIsSelectedBlock:(BoardIsSelectedBlock)_isSelectedBlock
View
15 PicShareClient_iOS/PicShareClient_iOS/PicShareEngine.m
@@ -13,7 +13,7 @@
#define UPLOAD_IMAGE 0
-NSString *picshareDomain = @"http://localhost:8000/";
+NSString *picshareDomain = @"http://picshare.herkuang.info:8000/";
@interface PicShareEngine ()
@@ -450,7 +450,7 @@ -(ErrorMessage *)followBoard:(NSInteger)boardId
}
if (response != nil) {
NSDictionary *dataDict = [response objectFromJSONString];
- ErrorMessage *em = [[ErrorMessage alloc]initWithJSONDict:dataDict];
+ ErrorMessage *em = [[[ErrorMessage alloc]initWithJSONDict:dataDict]autorelease];
NSLog(@"errorMessage:%@",em);
return em;
}
@@ -475,7 +475,7 @@ -(ErrorMessage *)followUser:(NSInteger)userId
}
if (response != nil) {
NSDictionary *dataDict = [response objectFromJSONString];
- ErrorMessage *em = [[ErrorMessage alloc]initWithJSONDict:dataDict];
+ ErrorMessage *em = [[[ErrorMessage alloc]initWithJSONDict:dataDict]autorelease];
NSLog(@"errorMessage:%@",em);
return em;
}
@@ -499,7 +499,7 @@ -(ErrorMessage *)unFollowBoard:(NSInteger)boardId
}
if (response != nil) {
NSDictionary *dataDict = [response objectFromJSONString];
- ErrorMessage *em = [[ErrorMessage alloc]initWithJSONDict:dataDict];
+ ErrorMessage *em = [[[ErrorMessage alloc]initWithJSONDict:dataDict]autorelease];
NSLog(@"errorMessage:%@",em);
return em;
}
@@ -523,7 +523,7 @@ -(ErrorMessage *)unFollowUser:(NSInteger)userId
}
if (response != nil) {
NSDictionary *dataDict = [response objectFromJSONString];
- ErrorMessage *em = [[ErrorMessage alloc]initWithJSONDict:dataDict];
+ ErrorMessage *em = [[[ErrorMessage alloc]initWithJSONDict:dataDict]autorelease];
NSLog(@"errorMessage:%@",em);
return em;
}
@@ -550,7 +550,7 @@ -(ErrorMessage *)updateBoard:(Board *)aBoard
}
if (response != nil) {
NSDictionary *dataDict = [response objectFromJSONString];
- ErrorMessage *em = [[ErrorMessage alloc]initWithJSONDict:dataDict];
+ ErrorMessage *em = [[[ErrorMessage alloc]initWithJSONDict:dataDict]autorelease];
NSLog(@"errorMessage:%@",em);
return em;
}
@@ -611,7 +611,7 @@ -(PictureStatus *)repin:(NSInteger)ps_id toBoard:(NSInteger)boardId withDescript
}
if (response != nil) {
NSDictionary *dataDict = [response objectFromJSONString];
- PictureStatus *ps = [[PictureStatus alloc]initWithJSONDict:dataDict];
+ PictureStatus *ps = [[[PictureStatus alloc]initWithJSONDict:dataDict]autorelease];
if (ps!=nil) {
return ps;
}else {
@@ -619,6 +619,7 @@ -(PictureStatus *)repin:(NSInteger)ps_id toBoard:(NSInteger)boardId withDescript
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:nil message:em.errorMsg delegate:nil cancelButtonTitle:@"知道了" otherButtonTitles:nil];
[alert performSelectorOnMainThread:@selector(show) withObject:nil waitUntilDone:YES];
[alert release];
+ [em release];
}
}
return nil;
View
1  PicShareClient_iOS/PicShareClient_iOS/TimelineCell.h
@@ -26,6 +26,7 @@
@property (nonatomic,retain) UIButton *repinButton;
@property (nonatomic,retain) UITextField *commentTextField;
@property (nonatomic,retain) ASIHTTPRequest *request;
+@property (nonatomic,retain) UILabel *viaLabel;
- (void)refreshWithPictureStatus:(PictureStatus *)aPictureStatus;
View
14 PicShareClient_iOS/PicShareClient_iOS/TimelineCell.m
@@ -20,7 +20,7 @@ @interface TimelineCell ()
@implementation TimelineCell
-@synthesize avatarImageView,usernameButton,boardNameButton,picDescriptionLabel,mainImageView,repinButton,commentTextField,pictureStatus,viaButton,request;
+@synthesize avatarImageView,usernameButton,boardNameButton,picDescriptionLabel,mainImageView,repinButton,commentTextField,pictureStatus,viaButton,request,viaLabel;
- (void)dealloc
{
@@ -34,6 +34,7 @@ - (void)dealloc
[repinButton release];
[commentTextField release];
[viaButton release];
+ [viaLabel release];
[super dealloc];
}
@@ -50,6 +51,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
repinButton = [[UIButton buttonWithType:UIButtonTypeRoundedRect]retain];
commentTextField = [[UITextField alloc]init];
viaButton = [[UIButton buttonWithType:UIButtonTypeCustom]retain];
+ viaLabel = [[UILabel alloc]init];
[self.contentView addSubview:avatarImageView];
[self.contentView addSubview:usernameButton];
[self.contentView addSubview:boardNameButton];
@@ -57,6 +59,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
[self.contentView addSubview:mainImageView];
[self.contentView addSubview:repinButton];
[self.contentView addSubview:viaButton];
+ [self.contentView addSubview:viaLabel];
}
return self;
}
@@ -97,11 +100,10 @@ - (void)layout
CGRect viaButtonFrame = CGRectMake(0, 0, 0, 0);
if (pictureStatus.via !=nil) {
- UILabel *viaLabel = [[UILabel alloc]initWithFrame:CGRectMake(nameButtonFrame.origin.x, nameButtonFrame.origin.y+nameButtonSize.height+4, 35, 18)];
+ self.viaLabel.frame = CGRectMake(nameButtonFrame.origin.x, nameButtonFrame.origin.y+nameButtonSize.height+4, 35, 18);
viaLabel.font = [UIFont systemFontOfSize:14];
viaLabel.text = @"转自";
- [self.contentView addSubview:viaLabel];
- [viaLabel release];
+ [viaLabel setHidden:NO];
CGSize viaButtonSize = [pictureStatus.via.username sizeWithFont:[UIFont systemFontOfSize:14] constrainedToSize:CGSizeMake(320-8-(viaLabel.frame.origin.x+viaLabel.frame.size.width), 18) lineBreakMode:UILineBreakModeTailTruncation];
viaButtonFrame = CGRectMake(viaLabel.frame.origin.x+viaLabel.frame.size.width+8, viaLabel.frame.origin.y, viaButtonSize.width, viaButtonSize.height);
@@ -111,7 +113,11 @@ - (void)layout
[viaButton setTitleColor:RGBA(93, 145, 166, 1) forState:UIControlStateNormal];
viaButton.titleLabel.font = [UIFont systemFontOfSize:14];
[viaButton setContentVerticalAlignment:UIControlContentHorizontalAlignmentLeft];
+ [viaButton setHidden:NO];
+ }else {
+ [viaButton setHidden:YES];
+ [viaLabel setHidden:YES];
}
Please sign in to comment.
Something went wrong with that request. Please try again.