UIScrollView * sv = [[UIScrollView alloc] init]; //设置是否显示水平滚动条 sv.showsHorizontalScrollIndicator = YES; //设置是否显示垂直滚动条 sv.showsVerticalScrollIndica...
分类:
其他好文 时间:
2014-09-24 21:53:47
阅读次数:
187
NSMutableString * ms = [[NSMutableString alloc] initWithString:@"中华人民共和国"]; if (CFStringTransform((__bridge CFMutableStringRef)ms, 0, kCFStringTransf....
分类:
移动开发 时间:
2014-09-24 12:52:36
阅读次数:
219
去除Xcode6创建工程时自带的storyboard1. 删除storyboard文件,并在setting里面清空加载storyboard:2. 导入ViewController到appDelegate文件中此处复制粘贴的代码如下: self.window = [[UIWindow alloc] i...
分类:
其他好文 时间:
2014-09-23 23:09:45
阅读次数:
266
一、原型:extern void *malloc(unsigned int num_bytes);头文件:#include 或 #include (注意:alloc.h 与 malloc.h 的内容是全然一致的。)功能:分配长度为num_bytes字节的内存块说明:假设分配成功则返回指向被分配内.....
分类:
其他好文 时间:
2014-09-23 20:48:45
阅读次数:
195
RT
CIContext *context = [CIContext contextWithOptions:nil];
CIImage *inputImage = [[CIImage alloc] initWithImage:[UIImage imageNamed:@"1.png"]];
// create gaussian blur filter
CIF...
分类:
移动开发 时间:
2014-09-23 15:03:36
阅读次数:
394
1. @interface里: CLLocationManager *locationManager;2. 初始化: locationManager = [[CLLocationManager alloc] init];3. 调用请求: [locationManager reque...
分类:
移动开发 时间:
2014-09-23 10:45:54
阅读次数:
220
腾讯笔试题,设计内存池,alloc和free都是O(1)。和LRUCache类似,这里用了一个list表示可用的空间,用一个map来记录这块内存是否已分配,这样free的时候才可能O(1)。 1 class MemPool { 2 public: 3 void init(in...
分类:
其他好文 时间:
2014-09-22 23:29:03
阅读次数:
140
要得到当前的位置,只需要2步就能完成 1:判断设备是否支持定位功能,然后创建MKMapViewif ([CLLocationManager locationServicesEnabled]) { myMapView =[[MKMapView alloc] init]; ...
分类:
移动开发 时间:
2014-09-22 13:41:22
阅读次数:
255
VFL语言实现以下界面:- (void)viewDidLoad{ [super viewDidLoad]; //创建上面的view UIView *topView = [[UIView alloc]init]; topView.backgroundColor = [UIColor redCo...
分类:
其他好文 时间:
2014-09-22 02:33:11
阅读次数:
198
涉及到内存管理问题的都是类类型的变量,而在OC中我们操纵这些对象都是通过操纵指向他们的指针来完成的,一致很多时候会忽略指针存在。比如定义UIView * view = [[UIView alloc]init];然后我们会使用view这个指针来做许多的操作。而由指针带来的一个性质是,当view =.....
分类:
其他好文 时间:
2014-09-20 15:57:49
阅读次数:
228