首页 > 移动平台
iOS OC语言: Block底层实现原理
先来简单介绍一下BlockBlock是什么?苹果推荐的类型,效率高,在运行中保存代码。用来封装和保存代码,有点像函数,Block可以在任何时候执行。 Block和函数的相似性:(1)可以保存代码(2)有返回值(3)有形参(4)调用方式一样。 Block 底层实现 定义一个简单的block 我们再给a ...
分类:移动平台   时间:2016-05-13 07:34:47    收藏:0  评论:0  赞:0  阅读:260
《CLR via C#》 第22章 CLR寄宿和AppDomain 跨越AppDomain边界访问对象
跨越AppDomain边界访问对象 将书中的代码(3处)将“MarshalByRefType”修改为“typeof(MarshalByRefType).FullName”,即可得到书中的输出结果: 将:MarshalByRefType mbrt = (MarshalByRefType)ad2.Cre ...
分类:移动平台   时间:2016-05-13 07:33:27    收藏:0  评论:0  赞:0  阅读:248
IOS NSBundle 的理解和 mainBundle 类方法详解
常看到类似的 这样的代码,用来获取 file 的完全路径。 那么它是什么东西呢:先看 NSBundle 类,直接继承NSObject类。 这个类的对象,代表了 app 中代码和资源的文件在文件系统里所在的位置,通俗的说,就是定位了程序使用的资源(代码,图形,音乐等数据)在文件系统里的位置,并可以动态 ...
分类:移动平台   时间:2016-05-13 07:26:57    收藏:0  评论:0  赞:0  阅读:174
iOS实现图片的缩放和居中显示
直接上代码////MoveScaleImageController.h//MoveScaleImage////Createdbyon12-4-24.//Copyright(c)2012年__MyCompanyName__.Allrightsreserved.//#import<UIKit/UIKit.h>#import"MoveScaleImageView.h"@interfaceMoveScaleImageController:UIViewController<UIScroll..
分类:移动平台   时间:2016-05-13 05:17:07    收藏:0  评论:0  赞:0  阅读:289
iOS指定程序启动后初始的ViewController
-(BOOL)application:(UIApplication*)applicationdidFinishLaunchingWithOptions:(NSDictionary*)launchOptions{//Overridepointforcustomizationafterapplicationlaunch.self.window=[[UIWindowalloc]initWithFrame:[[UIScreenmainScreen]bounds]];UIStoryboard*storyboard=[U..
分类:移动平台   时间:2016-05-13 05:16:47    收藏:0  评论:0  赞:0  阅读:187
iOS ViewController添加Segue
有时候需要判断逻辑再弹出View,这样子的话就不能直接通过按钮的Segue来弹出,就需要添加代码来控制segue。此时segue的添加(那个箭头),需要在viewcontroller之间建立。需要注意的是!源viewcontroller需要在左侧栏右击!给segue添加好id,直接用这一句话可以搞定。[selfperf..
分类:移动平台   时间:2016-05-13 05:16:37    收藏:0  评论:0  赞:0  阅读:169
iOS tabbar视图中隐藏tabbar
有时会遇到这样的情况:主框架是tabbar,tabbar中某个子视图是navigationcontroller,从navigationcontroller中弹出一个新的视图,新的视图需要隐藏tabbar,例如设置这种情形。有个属性叫做hidebottombaronpush的。可以在属性面板中找到。勾上就可以实现隐藏的效果。
分类:移动平台   时间:2016-05-13 05:16:27    收藏:0  评论:0  赞:0  阅读:196
iOS 更改navigationcontroller pop出来的视图返回按钮
在navigationcontroller的情况下,pop一个视图出来之后,返回键默认是一个返回箭头和源视图的题目。如果没有题目,就是一个英文的back。那如果要修改这个返回按钮的话应该怎么做呢?首先拖一个barbuttonitem到左上方。这样子就替代了默认的按钮了。此时还不会有响应。此时需要..
分类:移动平台   时间:2016-05-13 05:16:17    收藏:0  评论:0  赞:0  阅读:204
iOS AFNetWorking下同步异步请求
//阻塞-(User*)findUser:(NSNumber*)userID{NSString*url=[NSStringstringWithFormat:@"%@/s/account/find-user/",ServerBaseURL];NSMutableDictionary*requestParms=[[NSMutableDictionaryalloc]init];[requestParmssetObject:userIDforKey:@"userId"];AFJSONRequestSerialize..
分类:移动平台   时间:2016-05-13 05:15:57    收藏:0  评论:0  赞:0  阅读:260
iOS使用GPUImage实现实时反色相机
1新建一个singleview工程,导入GPUImage库2添加属性GPUImageVideoCamera*videoCamera;GPUImageOutput*filter;3viewDidload里面添加代码:videoCamera=[[GPUImageVideoCameraalloc]initWithSessionPreset:AVCaptureSessionPreset640x480cameraPosition:AVCaptureDevicePositionB..
分类:移动平台   时间:2016-05-13 05:14:37    收藏:0  评论:0  赞:0  阅读:220
iOS添加GPUImage到项目
1.把GPUImage.xcodeproj拖到你的Xcodeproject2.在app的target依赖设置里面添加GPUImage.a作为TargetDependency3.在buildphase的LinkBinaryWithLibraries,把libGPUImage.a加进来.4.添加下面这些系统framework:CoreMediaCoreVideoOpenGLESAVFoundationQuartzCore5.头文件搜索路径..
分类:移动平台   时间:2016-05-13 05:14:27    收藏:0  评论:0  赞:0  阅读:205
iOS跳过依赖检查的pod命令
podinstall--verbose--no-repo-update
分类:移动平台   时间:2016-05-13 05:13:27    收藏:0  评论:0  赞:0  阅读:195
iOS图像处理之裁剪
两行代码而已CGRectcutRect=CGRectMake(originImage.size.width/2,originImage.size.height/2,originImage.size.width/2,originImage.size.height/2);UIImage*cutImage=[UIImagep_w_picpathWithCGImage:CGImageCreateWithImageInRect([originImageCGImage],cutRect)];
分类:移动平台   时间:2016-05-13 05:12:17    收藏:0  评论:0  赞:0  阅读:201
iOS图像处理之绘制直线
-(void)drawLine:(CGPoint)fromPnttoPoint:(CGPoint)toPnt{floatxScale=theImageView.p_w_picpath.size.width/theImageView.frame.size.width;floatyScale=theImageView.p_w_picpath.size.height/theImageView.frame.size.height;UIGraphicsBeginImageContext(theImageView.p_w..
分类:移动平台   时间:2016-05-13 05:12:07    收藏:0  评论:0  赞:0  阅读:165
iOS图片的压缩
1.压缩质量UIImageJPEGRepresent2.压缩分辨率-(UIImage*)scaleToSize:(UIImage*)imgsize:(CGSize)size{//创建一个bitmap的context//并把它设置成为当前正在使用的contextUIGraphicsBeginImageContext(size);//绘制改变大小的图片[imgdrawInRect:CGRectMake(0,0,size.width,size..
分类:移动平台   时间:2016-05-13 05:12:01    收藏:0  评论:0  赞:0  阅读:207
iOS textview排版
-(IBAction)changeText:(id)sender{NSMutableParagraphStyle*paragraphStyle=[[NSMutableParagraphStylealloc]init];paragraphStyle.alignment=NSTextAlignmentCenter;paragraphStyle.paragraphSpacing=12.0f;NSMutableDictionary*attributes=[NSMutableDictionarydictionary];..
分类:移动平台   时间:2016-05-13 05:11:47    收藏:0  评论:0  赞:0  阅读:210
iOS EGORefreshTableHeaderView使用方法
废话不多说,直接上传代码说明1.把EGORefreshTableHeaderView.h和EGORefreshTableHeaderView.m文件拉入到工程2.viewcontroller文件添加引用#import"EGORefreshTableHeaderView.h"和协议<</span>EGORefreshTableHeaderDelegate>3.定义对象EGORefreshTableHeaderView..
分类:移动平台   时间:2016-05-13 05:11:37    收藏:0  评论:0  赞:0  阅读:153
iOS表示图下拉刷新控件
UIRefreshControl用的是这个控件。UITableViewController中有refreshControl这个属性。表格的初始化和数据设置与常规一致。1:初始化UIRefreshControl控件,并绑定下拉事件//添加下拉刷新控件UIRefreshControl*rc=[[UIRefreshControlalloc]init];rc.attributedTitle=[[NSAttrib..
分类:移动平台   时间:2016-05-13 05:11:27    收藏:0  评论:0  赞:0  阅读:251
iOS NSArray,结构体
添加结构体,用nsvlue类typedefstruct{NSUIntegerline;NSUIntegerrow;}TileLocation;//转换为NSValueNSValue*value=[NSValuevalueWithBytes:&tileLocobjCType:@encode(TileLocation)];//转换回结构体TileLocationloc;[valuegetValue:&loc];CGRectrect1=CGRectMake(0,0,..
分类:移动平台   时间:2016-05-13 05:10:59    收藏:0  评论:0  赞:0  阅读:173
android 运用AsyncTask 获取图片并显示
为什么BitmapFactory.decodeByteArray()返回null问题activity_main.xml布局里面一个按钮跟一个imageView<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:lay...
分类:移动平台   时间:2016-05-13 04:37:37    收藏:0  评论:0  赞:0  阅读:266
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!