Skip to content

Commit 1380453

Browse files
authored
Merge pull request #3 from kbonana/develop
Develop
2 parents 7b76fa3 + 5a61589 commit 1380453

File tree

4 files changed

+11
-9
lines changed

4 files changed

+11
-9
lines changed

Examples/iOSExample/iOSExample/AppDelegate.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(
2020
// Override point for customization after application launch.
2121

2222
LogInfo(@"提示信息");
23-
LogWarm(@"警告信息");
23+
LogWarn(@"警告信息");
2424
LogError(@"错误信息");
2525
return YES;
2626
}

Examples/iOSExample/iOSExample/PrefixHeader.pch

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
#define XCODE_COLORS_RESET XCODE_COLORS_ESCAPE @";" // Clear any foreground or background color
2424

2525
#define LogInfo(frmt, ...) NSLog((XCODE_COLORS_ESCAPE @"fg85,85,75;%s+%d " frmt XCODE_COLORS_RESET),__func__,__LINE__, ##__VA_ARGS__)
26-
#define LogWarm(frmt, ...) NSLog((XCODE_COLORS_ESCAPE @"fg209,57,168;%s+%d " frmt XCODE_COLORS_RESET),__func__,__LINE__, ##__VA_ARGS__)
26+
#define LogWarn(frmt, ...) NSLog((XCODE_COLORS_ESCAPE @"fg153,102,51;%s+%d " frmt XCODE_COLORS_RESET),__func__,__LINE__, ##__VA_ARGS__)
2727
#define LogError(frmt, ...) NSLog((XCODE_COLORS_ESCAPE @"fg255,0,0;%s+%d " frmt XCODE_COLORS_RESET),__func__,__LINE__, ##__VA_ARGS__)
2828
#else
2929
#define LogInfo(frmt, ...)
30-
#define LogWarm(frmt, ...)
30+
#define LogWarn(frmt, ...)
3131
#define LogError(frmt, ...)
3232
#define NSLog(...)
3333
#endif

Examples/iOSExample/iOSExample/Weibo/HomeTimelineController.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ @implementation HomeTimelineController
2424
- (void)viewDidLoad {
2525
[super viewDidLoad];
2626
// Do any additional setup after loading the view.
27-
LogWarm(@"%@",NSHomeDirectory());
27+
LogWarn(@"%@",NSHomeDirectory());
2828

2929

3030
self.title = @"消息";

Examples/iOSExample/iOSExample/Weibo/ProfileViewController.m

+7-5
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ - (void)viewDidLoad {
2222
[super viewDidLoad];
2323
// Do any additional setup after loading the view from its nib.
2424
[_tableView registerNib:[UINib nibWithNibName:@"ProfileTableViewCell" bundle:nil] forCellReuseIdentifier:@"profilecell"];
25-
marr = [NSMutableArray arrayWithObject:@"row-0"];
25+
marr = [NSMutableArray arrayWithObject:[NSMutableString stringWithFormat:@"row-0"]];
2626
}
2727

2828
- (void)addItem:(id)sender {
29-
[marr insertObject:[NSString stringWithFormat:@"row-%zd",marr.count] atIndex:0];
29+
[marr insertObject:[NSMutableString stringWithFormat:@"row-%zd",marr.count] atIndex:0];
3030
[_tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationBottom];
3131
}
3232

@@ -41,12 +41,14 @@ - (IBAction)removeItem:(id)sender {
4141

4242
- (IBAction)updateItem:(id)sender {
4343
NSIndexPath *indexPath = [_tableView indexPathForCell:[sender superview].superview];
44+
45+
NSMutableString *removedObj = [marr objectAtIndex:indexPath.row];
46+
[removedObj appendString:@"更新"];
47+
[_tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:indexPath.row inSection:0]] withRowAnimation:UITableViewRowAnimationAutomatic];
4448
[_tableView beginUpdates];
45-
id removedObj = [marr objectAtIndex:indexPath.row];
4649
[marr removeObjectAtIndex:indexPath.row];
47-
[_tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationTop];
4850
[marr insertObject:removedObj atIndex:0];
49-
[_tableView insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:0 inSection:0]] withRowAnimation:UITableViewRowAnimationBottom];
51+
[_tableView moveRowAtIndexPath:[NSIndexPath indexPathForRow:indexPath.row inSection:0] toIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
5052
[_tableView endUpdates];
5153
}
5254

0 commit comments

Comments
 (0)