随笔分类 - IOS开发
摘要://创建 UILabel UILabel *label1 = [[UILabel alloc] initWithFrame:CGRectMake(20, 40, 280, 80)]; //设置背景色 label1.backgroundColor = [UIColor grayColor]; //设置tag label1.tag = 91; //设置标签文本 label1.text = @"Hello world!"; //设置标签文本字体和字体大小 label1.font = [UIFont fontWithName:@"Arial...
阅读全文
摘要://这里创建一个圆角矩形的按钮 UIButton *button1 = [UIButton buttonWithType:UIButtonTypeRoundedRect]; // 能够定义的button类型有以下6种, // typedef enum { // UIButtonTypeCustom = 0, 自定义风格 // UIButtonTypeRoundedRect, 圆角矩形 // UIButtonTypeDetailDisclosure, 蓝...
阅读全文
摘要:当调用ASIHTTPRequest 发送GET请求时,发现请求了多次。原因在于使用GET时的默认行为是允许持久连接的,当网络不稳定,GET初次请求失败时,会重新发送请求。
阅读全文
摘要:OC内存管理黄金法则(译文):如果一个对象使用了alloc,[mutable]copy,retain,那么你必须使用相应的release或者autorelease释放。Xcode建立Command Line Tool项目:DogSample,选择手动管理内存,并添加Dog和Person类。Dog有唯一标识的ID属性,Dog.h代码:#import <Foundation/Foundation.h>@interface Dog : NSObject{ int _ID;}@property int ID;@end添加对象retainCount=0时自动调用的dealloc 函数,Dog
阅读全文

浙公网安备 33010602011771号