学习tableview官网例子

本文探讨了UITableView的使用方法及NSTimeZone的相关API。通过具体实例介绍了如何利用NSTimeZone获取不同类型的时区信息,并演示了NSString的比较函数与数组排序的方法。此外,还涉及了NSLocalizedString的用法。

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文件取数据;

明天继续...

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值