1.刷新单个tableviewcell
2.
BOOL isss=
int (^oneFrom)(int) = ^(int anInt) {
};
4.
UIImageView * iv = [[UIImageView alloc] initWithFrame:CGRectMake(250, 5, 50, 34)];
5. 默认为cell第一行
6.一个项目中
点击项目--》TARGETS-》Build Phases
1.如果是ARC项目,要加入非ARC的代码文件
2.如果是非ARC,要加入ARC的代码
//
//
//
//
//
//
7.距离感应器
UIDeviceOrientation orientation3=
8.获得cookie
9.从相册中只获得视频文件
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerS
KiloNetAppDelegate *appdelegate = (KiloNetAppDelegate *)[[UIApplication sharedApplication] delegate];
11.键盘透明
textField.keyboardAppearance = UIKeyboardAppearanceAler Error
解决办法:
NSString*url
13.请求中加cookie、 heard
当你需要添加更多的请求信息时,如,添加个请求Header:
[request addRequestHeader:@"name" value:@"Jory lee"];
14
[dictplist setObject:self.strWeb_id forKey:@"web_id"];
15.获取文件夹的大小
-(long long) fileSizeAtPath:(NSString*) filePath{
}
16.改变tablevlewcell点击的颜色
cell.selectedBackgroundView = [[[UIView alloc] initWithFrame:cell.frame] autorelease];
字
cell.textLabel.highlightedTextColor
点击后,过段时间cell自动取消选中
- (void)deselect
{
}
17.改变UITableViewStyleGrouped背景颜色
self.tableVieww.backgroundColor =[UIColor colorWithPatternImage:[UIImage imageNamed:@"更多背景图.png"]];
18.视图反转
//垂直
19.改变icon的阴影圆圈,取消图标上的高光
gloss
20.动态UIlable后添加图片
//判断男女
//时间差
- (NSString *)intervalSinceNow: (NSString *) theDate
{
}
22.按钮在cell上单击第几行
在cell.contentView上:
//获得row
NSInteger row = [[self.tableView indexPathForCell:(UITableViewCell *)[[sender superview] superview]] row];
//获得section
NSInteger row = [[self.tableView indexPathForCell:(UITableViewCell *)[[sender superview] superview]] section];
//获得indexPath
NSIndexPath *indexPath = [self.tableView indexPathForCell:(UITableViewCell *)[[sender superview] superview]];
- (void)
{
}
24.模拟器不能运行的错误
dyld: Library not loaded: @rpath/SenTestingKit.framework/Versi*****/A/SenTestingKit
把SentestingKit。 frameWork 有原来的required改为Optional
25.还原状态栏
显示原来的状态栏
//重新设定标题栏显示的位置
(2)
在别的页面[[UIApplication
- (int)getVideopTime:(NSURL * )videourl
{
}
27.视频播放器 循环播放 大小……
(2).avplayer
[[NSNotificationCenter defaultCenter] addObserver:self
- (void)playerItemDidReachEnd:(NSNotification *)notification {
}
28.sina微博错误返回值格式
http://open.weibo.com/wiki/Error_code
29.ios 获得文件夹的大小
//计算文件夹下文件的总大小
-(long)fileSizeForDir:(NSString*)path
{
30.
//搜索用谓词过滤数组
31.多线程的多种创建
//
//
//[NSThread detachNewThreadSelector:@selector(thAction) toTarget:self withObject:nil];
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
//
32.用多线程开启Nstimer提高精确度
//用多线程开启nstimer提高精确度
- (void)mutiThread
{
}
- (void)timerAction:(NSTimer * )timer
{
}
33.判断此页面是push,还是模态过来的
34。等比例放大缩小视图
35.清掉编译文件
~/Library/Developer/Xcode/DerivedData
模拟器清空编译
~/Library/Application Support/iPhone Simulator/
36.改变状态栏的颜色状态
37.给自己的项目中添加特殊的标示符号
http://patorjk.com/software/taag/#p=moreopts&h=0&v=1&f=优雅&t=V
38 清空某个文件夹
39. 在document下创建文件
40.layoutSubviews在以下情况下会被调用:
1、init初始化不会触发layoutSubviews
2、addSubview会触发layoutSubviews
3、设置view的Frame会触发layoutSubviews,当然前提是frame的值设置前后发生了变化
4、滚动一个UIScrollView会触发layoutSubviews
5、旋转Screen会触发父UIView上的layoutSubviews事件
6、改变一个UIView大小的时候也会触发父UIView上的layoutSubviews事件
41.苹果审核加急通道
https://developer.apple.com/appstore/contact/?topic=expedite
51 .美化配置git log
$ git config --global alias.lg "log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --" $ git lg
52.查看远程 git
git remote show origin
53.显示远程git仓库
git remote show
54.OC冒泡排序
//NSMutableArray 自带排序方法 NSMutableArray *lastArrary = [NSMutableArray arrayWithArray:sinceArray]; [lastArrary sortedArrayUsingSelector :@selector(compare:)]; - (NSComparisonResult)compare:(NSNumber *)otherNumber { // 设置升 降序 return NSOrderedDescending; }
// 冒泡排序 NSMutableArray *sinM_Array = [NSMutableArray arrayWithArray:sinceArray];for (int x = 0; x < sinceArray.count -1; x ++) { for (int y = x + 1; y < sinceArray.count - 1 -x; y ++) { int leftNum = [[sinM_Array objectAtIndex:x] intValue]; int rightNum = [[sinM_Array objectAtIndex:y]intValue]; if (leftNum > rightNum) { [sinM_Array replaceObjectAtIndex:x withObject:[NSNumber numberWithInt:leftNum]]; [sinM_Array replaceObjectAtIndex:y withObject:[NSNumber numberWithInt:rightNum]]; } } }
55.前后摄像头的切换
- (AVCaptureDevice *)cameraWithPosition:(AVCaptureDevicePosition)position
{
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
for ( AVCaptureDevice *device in devices )
if ( device.position == position )
return device;
return nil;
}
- (void)backCarme:(UIButton *)button
{
NSArray *inputs = self.session.inputs;
for ( AVCaptureDeviceInput *input in inputs ) {
AVCaptureDevice *device = input.device;
if ( [device hasMediaType:AVMediaTypeVideo] ) {
AVCaptureDevicePosition position = device.position;
AVCaptureDevice *newCamera = nil;
AVCaptureDeviceInput *newInput = nil;
if (position == AVCaptureDevicePositionF ront)
newCamera = [self cameraWithPosition:AVCaptureDevicePositionB ack];
else
newCamera = [self cameraWithPosition:AVCaptureDevicePositionF ront];
newInput = [AVCaptureDeviceInput deviceInputWithDevice:newCamera error:nil];
[self.session beginConfiguration];
[self.session removeInput:input];
[self.session addInput:newInput];
[self.session commitConfiguration];
break;
}
}
}
56.#pragma mark --获得视频的尺寸
-(CGSize)getImage:(NSURL *)url
{
}
57.播放音频
// 导入框架 AudioToolbox.framework
原文地址:http://blog.sina.com.cn/s/blog_801997310101cthq.html