随笔分类 - Objective-C
摘要:确定是否customView中使用了Masonry,使用masonry自动布局会造成customView中child点击事件失效
阅读全文
摘要:Objective-C 对 URL 进行 URLEncode 编码 在 iOS 程序访问 HTTP 资源时需要对 URL 进行 Encode,比如像拼出来的 +&sd f&p2=中文,其中的中文、特殊符号&%和空格都必须进行转译才能正确访问。 在 Java、.net 和 JS 中都有相应的 enco
阅读全文
摘要:- (BOOL)application:(UIApplication *)application shouldAllowExtensionPointIdentifier:(NSString *)extensionPointIdentifier { return NO; }
阅读全文
摘要:应用中有时我们会有保存图片的需求,如利用UIImagePickerController用IOS设备内置的相机拍照,或是有时我们在应用程序中利用UIKit的 UIGraphicsBeginImageContext,UIGraphicsEndImageContext,UIGraphicsGetImage
阅读全文
摘要://相册权限头文件 #import //判断是否有权限 ALAuthorizationStatus author = [ALAssetsLibrary authorizationStatus]; if (author == AVAuthorizationStatusRestricted || author ==AVAuthorizationStatusDenied){ //无权限...
阅读全文
摘要:#import "XLabel.h" @implementation XLabel -(BOOL)canBecomeFirstResponder { return YES; } // 可以响应的方法 -(BOOL)canPerformAction:(SEL)action withSender:(id)sender { return (action == @selecto...
阅读全文
摘要:如果你想使用定制菜单项,下面代码比较隐晦,但非常灵活。你需要检测是否用户长按并显示菜单,而最简单的方法就是在表格单元格中使用 UILongPressGestureRecognizer 为了让菜单显示,目标视图必须在 responder 链中,很多 UIKit 视图默认并无法成为一个 responde
阅读全文
摘要:这样一来,一个可复制的UILabel就诞生了!它能处理接收点击、弹出菜单栏、处理copy,这是一个很普通的可复制控件。 // 在PasteBoardWrite里面点“写入”后把textField中的文本写入粘贴板,然后切换到PasteBoardRead的时候显示出来。如果我们的粘贴板只想给“自己人”
阅读全文
摘要:CATransition *transition = [CATransition animation]; transition.duration = 1.0f; transition.timingFunction = [CAMediaTimingFunction functionWithName:k
阅读全文
摘要:1.快速配置表格,不需要写很多item https://github.com/escoz/quickdialog https://github.com/migueldeicaza/MonoTouch.Dialog http://escoz.com/open-source/quickdialog 2.
阅读全文
摘要:1.AFNetworking地址:https://github.com/AFNetworking/AFNetworking用于网络请求 2.JSONKit地址:https://github.com/johnezang/JSONKit解析JSON 3.Reachability地址:https://gi
阅读全文
摘要:如果tabar中设置的button高于tabar上方的分割线需要设置下方两项,缺一不可[[UITabBar appearance] setBackgroundImage:[[UIImage alloc] init]];[[UITabBar appearance] setShadowImage:[[U...
阅读全文
摘要:[Button_ setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
阅读全文
摘要:#import 1、 三角函数double sin (double);正弦double cos (double);余弦 double tan (double);正切2 、反三角函数 double asin (double); 结果介于[-PI/2, PI/2] double acos (dou...
阅读全文
摘要:第一部分、前几天做动画,使用到了CATransform3D ,由于没有学过计算机图形学,矩阵中m11--m44的各个含义都不清楚,经过几天研究总结如下:(供和我一样的菜鸟学习){CGFloat m11(x缩放), m12(y切变), m13(), m14();CGFloat m21(x切变), m2...
阅读全文
摘要:报错the file "xxx.app" couldn't be opened because you don't have permission to view it.后发现对应target的info文件中的字段Executable file (CFBundleExecutable)值是VANCL...
阅读全文
摘要:NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc]init];paragraphStyle.lineBreakMode = NSLineBreakByWordWrapping;上边两句代码一定要加,否则...
阅读全文
摘要:今天下午动手用了IOS自带的定位,结果在网上看了很多教程,也将示例代码直接运行,但就是一直无法获取位置,代码如下:首先导入CoreLocation.framework,然后再引入头文件#import定义属性?1@property (nonatomic , strong)CLLocationManag...
阅读全文
摘要:引人:iOS真机调试程序,报如下错误信息:failed to get the task for process XXX原因:证书问题,project和targets的证书都必须是开发证书,ADHOC的证书会出现此问题。解决方案:project和targets的证书使用开发证书。其他:failed t...
阅读全文
浙公网安备 33010602011771号