一下是自己遇到的或者是别人遇到的问题,问题和解决方案一并贴出。
1.tableheaderview 挡住 下面的cell 怎么解决?
用 sectionheader
2.从网上下载demo的时候发现test报错了,报错了也没有关系。这里有两种解决方案:
方案一:
下载下来的是这样的:
正确的设置是这样的----->>>>>
方案2:
方案2就你出错了是吧,跟我作对,行。改不起咱删的起,好吧。简单粗暴,删除test 删除与test 相关的文件。
3.
裸聊必备技能, 从摄像头采集 编码 封装成 ts, 传到服务器
AVCaptureVideoDataOutputSampleBufferDelegate
4. 约束约束
5.
消除cell的间隔
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
if ([cell respondsToSelector:@selector(setSeparatorInset:)])
{
[cell setSeparatorInset:UIEdgeInsetsZero];
}
if ([cell respondsToSelector:@selector(setLayoutMargins:)])
{
[cell setLayoutMargins:UIEdgeInsetsZero];
}
}
6. 判断是不是跟视图控制器
7.内购相关
8.ios8 以下 不要有马上设置按钮
方法只在iOS8起作用
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]];
9.
在折线图显示时,第三方框架
coreplot
10.
ps: 找出不支持arm64的静态库 find . -name *.a -exec lipo -info "{}" \;
11.afn 本身不带同步功能, 可以使用信号或 runloop 实现, 也可以不用 afn 直接用 urlconnection 实现
12.
在storyboard中拖线,在A控制器中重写这个方法,就能完美的阻止PUSH动作
-(BOOL)shouldPerformSegueWithIdentifier:(NSString *)identifier sender:(id)sender {
return YES;
}
- (BOOL)navigationBar:(UINavigationBar *)navigationBar shouldPushItem:(UINavigationItem *)item
13.
24:
iOS 8
buttons in horizontal scroll view intercepting pan event - scroll does not work
获得上下行流量
14.
socket.io 是基于 socketrocket 的, 你直接看这个库的源码就可以知道怎么从底层构建一个长链
- (void)_connectToHost:(NSString *)host port:(NSInteger)port;
{
CFReadStreamRef readStream = NULL;
CFWriteStreamRef writeStream = NULL;
CFStreamCreatePairWithSocketToHost(NULL, (__bridge CFStringRef)host, (UInt32)port, &readStream, &writeStream);
// Obtain all the background modes from the Info.plist file in the target project
NSArray* backgroundModesEnabled = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"UIBackgroundModes"];
if (backgroundModesEnabled && [backgroundModesEnabled containsObject:@"voip"]) {
// Background Mode and the VOIP flag is found in the plist file. Set the socket type for the read and write stream to VOIP for background usage
CFReadStreamSetProperty(readStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP);
CFWriteStreamSetProperty(writeStream, kCFStreamNetworkServiceType, kCFStreamNetworkServiceTypeVoIP);
}
_outputStream = CFBridgingRelease(writeStream);
_inputStream = CFBridgingRelease(readStream);
if (_secure) {
NSMutableDictionary *SSLOptions = [[NSMutableDictionary alloc] init];
[_outputStream setProperty:(__bridge id)kCFStreamSocketSecurityLevelNegotiatedSSL forKey:(__bridge id)kCFStreamPropertySocketSecurityLevel];
// If we're using pinned certs, don't validate the certificate chain
if ([_urlRequest SR_SSLPinnedCertificates].count) {
[SSLOptions setValue:[NSNumber numberWithBool:NO] forKey:(__bridge id)kCFStreamSSLValidatesCertificateChain];
}
#if DEBUG
[SSLOptions setValue:[NSNumber numberWithBool:NO] forKey:(__bridge id)kCFStreamSSLValidatesCertificateChain];
NSLog(@"SocketRocket: In debug mode. Allowing connection to any root cert");
#endif
[_outputStream setProperty:SSLOptions
forKey:(__bridge id)kCFStreamPropertySSLSettings];
}
_inputStream.delegate = self;
_outputStream.delegate = self;
// TODO schedule in a better run loop
[_outputStream scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
[_inputStream scheduleInRunLoop:[NSRunLoop mainRunLoop] forMode:NSDefaultRunLoopMode];
[_outputStream open];
[_inputStream open];
}
15. bugHD 可以打印出 bug 记录崩溃日志
16.手把手教你ARC——iOS/Mac开发ARC入门和使用
17.producter
设计
18.宏定义的黑魔法
19.网页缓存
20.天狐博客
21.一个自定义的view 添加到父视图我记得会调用一个方法,方法名叫啥?
-(void)willMoveToSuperview:(UIView *)newSuperview
22.
Xib自定义Cell的高度为90,使用在TableView中的heightforrow中给的高度是60,但是出来的时候Cell高度却是90不是60
cell的clipsToBounds 为yes了..
其实cell的frame 就是你设置的60 超出了30
23.
我的表有三个区,我要把第二个区的分割线隐藏,第一和第三区的分割线还在,这个怎么做呀?
隐藏全部分割线. 自己需要的地方 addlayer
- (CAShapeLayer *) drawLineFromPoint:(CGPoint) p1 to:(CGPoint) p2{
CGMutablePathRef linePath = CGPathCreateMutable();
CAShapeLayer *lineShape = [CAShapeLayer layer];
lineShape.lineWidth = 0.5f;
lineShape.lineCap = kCALineCapRound;;
lineShape.strokeColor = [[UIColor colorFromHexString:@"#65a7c5"] CGColor];
CGPathMoveToPoint(linePath, NULL, p1.x, p1.y);
CGPathAddLineToPoint(linePath, NULL, p2.x, p2.y);
lineShape.path = linePath;
CGPathRelease(linePath);
return lineShape;
}
含有uibutton的ScrollView在iOS8中无法滚动的解决办法:
theScrollView.panGestureRecognizer.delaysTouchesBegan = theScrollView.delaysContentTouches
25.隐藏导航栏下的线
[self.navigationController.navigationBar setShadowImage:[UIImage new]];
[self.navigationController.navigationBar setBackgroundImage:[UIImage new]
forBarPosition:UIBarPositionAny
barMetrics:UIBarMetricsDefault];
[self.navigationController.navigationBar setBackgroundImage:[UIImage new]
forBarPosition:UIBarPositionAny
barMetrics:UIBarMetricsDefault];
遇到的问题就贴出来,指不定有人可以帮到你!