tableview东东:(主要是再学到tableview的时候,数组了,字典了都不太清楚,还得从头看.)
今天主要咕哝tableview东西,并且也没有看完.还得继续......
1.tableview suite里面的代码例子:(SimpleTableView)
NSTimeZone方法:
[NSTimeZone systemTimeZone] [NSTimeZone localTimeZone] [NSTimeZone defaultTimeZone] [NSTimeZone knownTimeZoneNames] [NSTimeZone timeZoneDataVersion] - (NSString *)name; - (NSData *)data;
NSString比较函数
case insensitive: 不区分大小写.
NSString *aa = @"aadfjelfgeca"; NSString *bb = @"Acdedlcoe"; NSComparisonResult i = [bb caseInsensitiveCompare: aa]; if (i == NSOrderedAscending | NSOrderedSame ) { NSLog( @"this is NSOrderedAscending" ); NSString *tmp; tmp = aa; aa = bb; bb = tmp; NSLog( @"bb is %@" , bb ); } else { NSLog( @"this is NSOrderedDescending" ); }
数组进行排序:
NSArray *a = [NSArray arrayWithObjects: @"Abbck",@"adfedl",@"dcfetcsaf",@"daa",nil]; NSArray *b; b = [a sortedArrayUsingSelector: @selector(caseInsensitiveCompare:)]; NSLog( @"b is %@" , a);
NSLocalizedString方法的用法:
self.title = NSLocalizedString(@"Time Zones", @"Time Zones title");
//
#define NSLocalizedString(key, comment) \
[[NSBundle mainBundle] localizedStringForKey:(key) value:@"" table:nil]
去Localizable.strings文件取数据;
明天继续...
本文探讨了UITableView的使用方法及NSTimeZone的相关API。通过具体实例介绍了如何利用NSTimeZone获取不同类型的时区信息,并演示了NSString的比较函数与数组排序的方法。此外,还涉及了NSLocalizedString的用法。
7288

被折叠的 条评论
为什么被折叠?



