摘要: //初始化labelUILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,0,0)];//设置自动行数与字符换行[label setNumberOfLines:0];label.lineBreakMode = UILineBreakModeWordWrap; // 测试字串NSString *s = @"这是一个测试!!!adsfsaf时发生发勿忘我勿忘我勿忘我勿忘我勿忘我阿阿阿阿阿阿阿阿阿阿阿阿阿啊00000000阿什顿。。。";UIFont *font = [UIFont fontWithName: 阅读全文
posted @ 2013-10-12 11:25 荒唐爱情 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 个人笔记,高手绕道普通方法解析xml:.h文件@property (nonatomic,strong) NSMutableArray *itemData;@property(nonatomic,assign)NSString *currentTagName;.m文件注意@synthesize上面的属性- (void)getxml{ NSString *xmlPath=[[NSString alloc] init]; xmlPath=[[NSBundle mainBundle] pathForResource:@"student" ofType:@"xml" 阅读全文
posted @ 2013-09-23 13:07 荒唐爱情 阅读(332) 评论(0) 推荐(2) 编辑
摘要: 通过使用IOS5自带解析类NSJSONSerialization方法解析JSON// //字典转json// NSDictionary *dict=[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"pangran",@"name",@"male",@"sex",@"23",@"age" ,nil];// NSLog(@"%@",dict);// NSError *error;// NSData *j 阅读全文
posted @ 2013-09-23 12:03 荒唐爱情 阅读(1020) 评论(0) 推荐(1) 编辑
摘要: UIButton *button = [[UIButton alloc] initWithFrame:CGRectMake(0,0,60,31)];[button setBackgroundImage:[UIImage imageNamed:@"abc.png"] forState:UIControlStateNormal];UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithCustomView:button];self.navigationItem.rightBarButtonItem = btn;[butto 阅读全文
posted @ 2013-09-13 17:24 荒唐爱情 阅读(799) 评论(0) 推荐(0) 编辑
摘要: objective-c字符串连接,转换NSString* string; // 结果字符串NSString* string1, string2; //已存在的字符串1. string = [NSString initWithFormat:@"%@,%@", string1, string2 ];2. string = [string1 stringByAppendingString:string2];3 . string = [string stringByAppendingFormat:@"%@,%@",string1, string2];复制代码这三 阅读全文
posted @ 2013-09-11 15:53 荒唐爱情 阅读(222) 评论(0) 推荐(0) 编辑