IOS常用的设计模式包括:单例模式、委托模式、观察者模式和MVC模式。
这里主要讲单例模式
单例模式
-问题: 主要解决应用中只有一个实例的问题(只需要某个类的实例)
-原理:一般会封装一个静态属性,并提供静态实例的创建方法
-应用:单例类
// Singleton.h
@interface Singleton : NSObject
+ (Singleton *)sharedM...
分类:
移动开发 时间:
2014-11-04 19:41:41
阅读次数:
177
#import #import #import @interface UIImage (Blur)// 0.0 to 1.0- (UIImage*)blurredImage:(CGFloat)blurAmount;@end#import "UIImage+Blur.h"@implementation...
分类:
移动开发 时间:
2014-11-04 19:28:41
阅读次数:
236
#import @interface UIImage (ImageWithColor)+ (UIImage *)imageWithColor:(UIColor *)color;@end#import "UIImage+ImageWithColor.h"@implementation UIImage ...
分类:
移动开发 时间:
2014-11-04 19:22:43
阅读次数:
726
UIImage+Screenshot.h#import @interface UIImage (Screenshot)+ (UIImage *)screenshot;@end#import "UIImage+Screenshot.h"@implementation UIImage (Screensh...
分类:
移动开发 时间:
2014-11-04 18:54:52
阅读次数:
163
转自博客地址:http://www.cnblogs.com/gw811/archive/2012/10/10/2718331.html Java API中java.io.Serializable接口源码:1 public interface Serializable {2 } 类通过实现java.....
分类:
编程语言 时间:
2014-11-04 17:04:59
阅读次数:
281
当前的路由: destination 目的网段 mask 子网掩码 interface 到达该目的地的本路由器的出口ip gateway 下一跳路由器入口的ip,路由器通过interface和gateway定义一调到下一个路由器的链路,通常情况下,interface和gateway是同一网段的 me...
分类:
其他好文 时间:
2014-11-04 16:43:54
阅读次数:
189
1、配置IP地址:vi/etc/network/interface///需要编辑的配置文件路径ifaceeth3inetstatic///指定接口和地址获取方式address192.168.19.131///配置IP地址netmask255.255.255.0///配置网络掩码gateway192.168.19.254///配置网关2、配置DNS:vim/etc/resolvconf/resolv.conf.d/bas..
分类:
系统相关 时间:
2014-11-04 15:23:11
阅读次数:
240
这个问题虽然不是很严重,但却困扰本人许久。曾经多方询问朋友、查阅资料均无法达到效果。今日偶然查到一些东西,经实测的却可行,也算了却了一桩心愿。不再废话直接贴DEMO代码 1 unit Unit2; 2 3 interface 4 5 uses 6 Vcl.Dialogs, Vcl.Forms...
分类:
其他好文 时间:
2014-11-04 14:57:33
阅读次数:
188
跨进程访问的服务称为AIDL(Android Interface Definition Language)服务。AIDL:Android Interface Definition Language,即Android接口定义语言。什么是AIDLAndroid系统中的进程之间不能共享内存,因此,需要提供...
分类:
其他好文 时间:
2014-11-04 14:55:40
阅读次数:
137
系统环境:Ubuntu 8.04xen-3.3.1错误提示:$xend startDevice “eth0” does not existifdown: interface eth0 not configured具体场景:使用xen桥接的模式下启动xend时候出现了错误,说eth0找不到。运行ifc...
分类:
其他好文 时间:
2014-11-04 12:39:02
阅读次数:
258