在c语言中,int和long的字节数是和操作系统指针所占位数相等。 但c语言中说,long的长度永远大于或等于int objective-c里,苹果的官方文档中总是推荐用NSInteger 它和int有什么区别呢,stackoverflow这帮大神给了答案。 原来在苹果的api实现中,NSInteg ...
分类:
其他好文 时间:
2017-06-15 00:41:32
阅读次数:
161
#import <Foundation/Foundation.h> @interface CommonZomble : NSObject { NSString * _zombleKind;//僵尸种类 NSInteger _totalBloodVolume;//总血量 NSInteger _ever ...
分类:
其他好文 时间:
2017-06-14 22:33:50
阅读次数:
180
事先准备一张图片: UIImage *image = [UIImage imageNamed:@"red.png"]; 在iOS 5.0之前能够这么用: NSInteger leftCapWidth = image.size.width * 0.5f; NSInteger topCapHeight ...
分类:
移动开发 时间:
2017-06-13 19:47:10
阅读次数:
348
//UIPickerViewDataSource中定义的方法,该方法的返回值决定该控件包含的列数 - (NSInteger)numberOfComponentsInPickerView:(UIPickerView*)pickerView { return 2; // 返回2表明该控件只包含2列 } ... ...
分类:
其他好文 时间:
2017-06-12 22:25:07
阅读次数:
181
//UIPickerViewDataSource中定义的方法,该方法的返回值决定该控件包含的列数 - (NSInteger)numberOfComponentsInPickerView:(UIPickerView*)pickerView { return 2; // 返回2表明该控件只包含2列 } ... ...
分类:
其他好文 时间:
2017-06-12 22:14:35
阅读次数:
207
- (void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section { view.tintColor = [UIColor clearColor]; ...
分类:
其他好文 时间:
2017-06-06 14:26:21
阅读次数:
246
[NSDate date]获取的是GMT时间,要想获得某个时区的时间,以下代码可以解决这个问题 NSDate *date = [NSDate date]; NSTimeZone *zone = [NSTimeZone systemTimeZone]; NSInteger interval = [zo ...
分类:
其他好文 时间:
2017-06-06 12:59:08
阅读次数:
125
一、MRC 与 ARC 各自的属性修饰符 二、内存管理修饰符 MRC 模式下属性修饰符 retain: 引用计数加1。 assign: 分配内存,类似于copy。常用于基本数据类型,比如:int,long,NSInteger等。 ARC 模式下属性修饰符 weak: 当引用计数为零时,将其置为nil ...
分类:
其他好文 时间:
2017-05-07 15:39:37
阅读次数:
146
ViewController.h #import <UIKit/UIKit.h> @interface ViewController : UIViewController { UIImage *_image; NSInteger _index; } @endViewController.m #imp ...
分类:
其他好文 时间:
2017-05-01 14:20:01
阅读次数:
148
UIApplication简介: 利用UIApplication对象能进行一些应用级别的操作。 设置应用程序图标右上角的红色提醒数字 @property(nonatomic) NSInteger applicationIconBadgeNumber; //代码实现和效果 UIApplication ...
分类:
移动开发 时间:
2017-04-25 13:24:52
阅读次数:
332