01 2016 档案

摘要:import UIKitclass InternetDataRequeset { //Post请求时, Body字符串转换成字典方法 //设置类型为静态方法 static func changeStringToDictionary(string : String)->NSDictiona... 阅读全文
posted @ 2016-01-22 15:06 LeoMabi 阅读(558) 评论(0) 推荐(0)
摘要:一:被代理人personOnepersonOne.h#import @protocol SomeThing//需要被代理的事件- (void)doSomeThing:(NSString *)someThing;@end@interface PersonOne : NSObject//有件事情需要别人... 阅读全文
posted @ 2016-01-21 09:53 LeoMabi 阅读(317) 评论(0) 推荐(0)
摘要:IOS 的@property和@synthesize帮我们轻易的生成对象的getter和setter方法来完成对对象的赋值和访问。但是如果我们如果要动态设置对象的getter和setter方法可以使用@property和@dynamic组合。对象访问方法property的属性设置非常多,诸如:ato... 阅读全文
posted @ 2016-01-20 17:16 LeoMabi 阅读(236) 评论(0) 推荐(0)
摘要:方法一:特点: 直接拨打, 不弹出提示。 并且, 拨打完以后, 留在通讯录中, 不返回到原来的应用。 //拨打电话 - (void)callPhone:(NSString *)phoneNumber { //phoneNumber = "18369......" NSMut... 阅读全文
posted @ 2016-01-20 09:40 LeoMabi 阅读(194) 评论(0) 推荐(0)
摘要:第一种:addsubviewUIView *line = [[UIView alloc]initWithFrame:CGRectMake(10, cellH-0.5, DEVW-10, 0.5)]; line.backgroundColor = ViewLineColor;第二种:自绘... 阅读全文
posted @ 2016-01-19 17:29 LeoMabi 阅读(537) 评论(0) 推荐(0)
摘要:if (!webviewHasLoaded && pdIntroduce.length>0) { webView = [[UIWebView alloc]initWithFrame:CGRectMake(10, 30 , DEVW-20, webviewH)]; ... 阅读全文
posted @ 2016-01-19 17:14 LeoMabi 阅读(695) 评论(0) 推荐(0)
摘要:UILabel *downloader = [[UILabel alloc]init]; NSString *downloadCount = [[LibraryArr objectAtIndex:indexPath.row]objectForKey:@"downloadCou... 阅读全文
posted @ 2016-01-19 11:41 LeoMabi 阅读(372) 评论(0) 推荐(0)
摘要:NSArray *imageArr = @[@[@"查看地图",@"map_hy.png"], @[@"联系号码",@"phone_hy.png"], @[@"我要咨询... 阅读全文
posted @ 2016-01-18 18:06 LeoMabi 阅读(151) 评论(0) 推荐(0)
摘要:tableviewName.tableFooterView = [[UIView alloc]initWithFrame:CGRectZero]; 阅读全文
posted @ 2016-01-18 18:03 LeoMabi 阅读(105) 评论(0) 推荐(0)
摘要:- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ if (section == 3) { return 0; } return 10;}... 阅读全文
posted @ 2016-01-18 18:02 LeoMabi 阅读(187) 评论(0) 推荐(0)
摘要:headimageView=[[UIImageView alloc] initWithFrame:CGRectMake(0, 0, DEVW, DEVW/2)]; headimageView.contentMode = UIViewContentModeScaleAspectFit; ... 阅读全文
posted @ 2016-01-18 15:22 LeoMabi 阅读(362) 评论(0) 推荐(0)
摘要:1:动态添加uibutton- (IBAction)addButton:(id)sender { CGRect frame = CGRectMake(90, 200, 200, 60); UIButton *someAddButton = [UIButton buttonWithType... 阅读全文
posted @ 2016-01-14 15:11 LeoMabi 阅读(561) 评论(0) 推荐(0)
摘要://计算文本高度 NSString *lltxt =[[NSString alloc]initWithFormat:@"浏览:%@",[strJson objectForKey:@"visitCount"]]; NSString *xztxt =[[NSString alloc]init... 阅读全文
posted @ 2016-01-11 15:34 LeoMabi 阅读(307) 评论(0) 推荐(0)
摘要:1.计算输入文字在指定字体、指定容器和指定换行方式下的size. CGSizeconstraintSize; constraintSize.width=300; constraintSize.height=MAXFLOAT; CGSizesizeFrame =[textContent sizeW... 阅读全文
posted @ 2016-01-11 15:18 LeoMabi 阅读(738) 评论(0) 推荐(0)
摘要://初始化 NSString *key1 = @"key1"; NSString *key2 = @"key2"; NSString *key3 = @"key3"; NSString *key4 = @"key4"; NSStr... 阅读全文
posted @ 2016-01-08 14:14 LeoMabi 阅读(122) 评论(0) 推荐(0)
摘要:/*---------------------NSArray---------------------------*///创建数组NSArray *array1 = [NSArray arrayWithObject:@"1"];NSArray *array2 = [NSArray arrayWith... 阅读全文
posted @ 2016-01-08 11:39 LeoMabi 阅读(148) 评论(0) 推荐(0)
摘要:NSString *reqData = @"Data=";NSData *postDatas = nil;NSString *urlPath = @"url";//组json字符串数据NSMutableDictionary *mulDic = [[[NSMutableDictionary alloc... 阅读全文
posted @ 2016-01-08 11:35 LeoMabi 阅读(949) 评论(0) 推荐(0)
摘要:NSString *str1 = @"BeiJing";NSString *str2 = @"beijing";//全部转为大写NSLog(@"%@",[str1 uppercaseString]);//全部转为小写NSLog(@"%@",[str1 lowercaseString]);//首字母大... 阅读全文
posted @ 2016-01-08 11:30 LeoMabi 阅读(341) 评论(0) 推荐(0)
摘要:int main(int argc, const char * argv[]){ @autoreleasepool { //----------------NSString----------------------------- NSStr... 阅读全文
posted @ 2016-01-08 10:49 LeoMabi 阅读(143) 评论(0) 推荐(0)
摘要:所谓的封装,就是通过定义方法或者函数去操作成员属性或者成员变量,而不是直接通过指针方式去操作。借此达到提高代码安全性,代码可行性以及代码执行效率的目的。1:初级封装,对成员变量进行封装。#import @interface Person : NSObject{ // @public int... 阅读全文
posted @ 2016-01-05 16:18 LeoMabi 阅读(187) 评论(0) 推荐(0)
摘要:1:Type Swift提供了类型推断,不需要人工的去注释变量的类型信息,编译器会通过变量的值来推断类型。例如,编译器可以自动将该变量设置为字符串:// 自动推断,不显示var name1 = "Matt"// 显示类型var name2:String = "Matt" 这也就意味着类型安全,编... 阅读全文
posted @ 2016-01-05 16:17 LeoMabi 阅读(238) 评论(0) 推荐(0)
摘要:1.Objective-C是C语言的超集,完全兼容C语言2.所有的关键字都以“@”开头,例如:@interface,@class,@implementation3.Objective-C的所有对象必须继承于NSObject,并且不存在多继承4.Objective-C支持协议,支持多态5.Id类型 类... 阅读全文
posted @ 2016-01-03 13:32 LeoMabi 阅读(212) 评论(0) 推荐(0)