NSDictionary *dictionary = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", @"v3", @"k3", @"v5", @"k5", @"v4", @"k...
分类:
其他好文 时间:
2014-08-01 09:09:51
阅读次数:
237
方法一:
NSMutableAttributedString *str = [[NSMutableAttributedString alloc] initWithString:@"查看所有中奖记录"];
NSRange strRange = {0,[str length]};
[str addAttribute:NSUnderlineStyleAttributeName ...
分类:
其他好文 时间:
2014-07-30 20:43:44
阅读次数:
468
NSNumber生成:NSNumber *number1 = [[NSNumber alloc] initWithInt:1000];转成NSNumber型:// short型→NSNumber型NSNumber *num = [NSNumber numberWithShort:32767];// ...
分类:
其他好文 时间:
2014-07-30 00:37:02
阅读次数:
204
-(void)shareWork:(id)sender{ UIActionSheet *share = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"关闭" destructiveButtonT....
分类:
其他好文 时间:
2014-07-29 17:01:12
阅读次数:
273
在oc中我们通过-(CardMatchingGame *)game{ if(!_game) _game=[[CardMatchingGame alloc] initWithCardCount:[self.cardButtons count] usingDeck:[self createDeck...
分类:
其他好文 时间:
2014-07-29 14:09:28
阅读次数:
173
//可以不被电池栏挡住+ (UILabel *)alertLabel{ UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 20.f, 320.f, 0.f)]; label.backgroundColor = [UICo...
分类:
其他好文 时间:
2014-07-29 12:44:16
阅读次数:
338
一、 可以通过代码的方式创建UIButton 1.通用实例化对象方法: UIButton *button = [[UIButton alloc] initWithFrame:rect]; 2.快速实例化对象方法: UIButton *button = [UIButton button...
分类:
其他好文 时间:
2014-07-29 12:30:57
阅读次数:
222
1、Cocoa对象的创建我们都知道创建一个对象有两步:alloc和init(对象分配和初始化),两步缺一不可。初始化一般都是紧接着对象分配的后面进行,但是这两个操作的作用是完全不同的。分配对象:就是Cocoa从应用程序的虚拟内存中为对象分配一块内存。Cocoa会根据对象的实例变量(类型和变量的排列顺...
分类:
其他好文 时间:
2014-07-29 12:17:56
阅读次数:
248
UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(50, 50, 150, 50)]; [button setTitle:@"HHH" forState:UIControlStateNormal]; [button s...
分类:
其他好文 时间:
2014-07-28 15:17:03
阅读次数:
320
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapOnce)];//定义一个手势[tap setNumberOfTouchesRequired:...
分类:
其他好文 时间:
2014-07-27 22:01:40
阅读次数:
202