penn-wang
一位老和尚,他身边聚拢着一帮虔诚的弟子。这一天,他嘱咐弟子每人去南山打一担柴回来。弟子们匆匆行至离山不远的河边,人人目瞪口呆。只见洪水从山上奔泻而下,无论如何也休想渡河打柴了。无功而返,弟子们都有些垂头丧气。唯独一个小和尚与师傅坦然相对。师傅问其故,小和尚从怀中掏出一个苹果,递给师傅说,过不了河,打不了柴,见河边有棵苹果树,我就顺手把树上唯一的一个苹果摘来了。后来,这位小和尚成了师傅的衣钵传人。

随笔分类 -  IOS

如题
10.11 安装pod
摘要:原文地址:http://www.jianshu.com/p/5fc15906c53a 感谢。更新升级10.11 cocoapods安装出问题最简单的解决方法这是因为10.11把cocoapods直接干掉了sudo gem install -n /usr/local/bin cocoapods再加一句... 阅读全文
posted @ 2015-11-30 17:24 penn-wang 阅读(196) 评论(0) 推荐(0)
lib制作
摘要:生成模拟器和真机通用lib命令:lipo -create libKIF-os.a libKIF-simulator.a -output libKIF.a。需要cd到 愿文件.a所在的目录。libKIF-os.a libKIF-simulator.a 分别为 真机 和模拟器 的 lib文件libKIF... 阅读全文
posted @ 2015-02-26 10:49 penn-wang 阅读(152) 评论(0) 推荐(0)
UIBezierPath IOS贝塞尔曲线
摘要://记录 贝塞尔曲线使用//根据一个矩形画曲线+ (UIBezierPath *)bezierPathWithRect:(CGRect)rect//根据矩形框的内切圆画曲线+ (UIBezierPath *)bezierPathWithOvalInRect:(CGRect)rect//根据矩形画带圆... 阅读全文
posted @ 2014-10-22 16:47 penn-wang 阅读(255) 评论(0) 推荐(0)
正则表达式
摘要:/*邮箱验证 MODIFIED BY HELENSONG*/-(BOOL)isValidateEmail:(NSString *)email{ NSString *emailRegex = @"[A-Z0-9a-z._%+-]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,4}"; NSPredicate *emailTest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", emailRegex]; return [emailTest evaluateWithObject:emai 阅读全文
posted @ 2014-04-11 22:06 penn-wang 阅读(136) 评论(0) 推荐(0)
ios开发零食
摘要:1屏幕尺寸ios屏幕尺寸:(不包括状态烂20)(320*460) (320*548)注意:这个数字,不是像素。而是:uiscreen 的mainscreen 像素与屏幕之间的映射值。也就是说:开发之中常用的 cgrect cgpoing 等等值,都是建立在这个映射值之上的。2目录管理沙盒路径获得:[[NSBundlemainBundle] bundlePath];(沙盒下为只读)/Users/wangpengfei/Library/Application Support/iPhone Simulator/6.1/沙盒下对应的文件获得:NSString *cc =[[[NSBundlemainB 阅读全文
posted @ 2013-03-19 11:21 penn-wang 阅读(144) 评论(0) 推荐(0)
后台下载相关代码
摘要:- (void)applicationDidEnterBackground:(UIApplication *)application {/* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application s 阅读全文
posted @ 2013-03-13 17:31 penn-wang 阅读(163) 评论(0) 推荐(0)
ios 类别和扩展
摘要:对于这两个东西,经常使用。问题是没有系统的认识。结合网上东西,自己记录一下!http://www.cnblogs.com/darkangle/archive/2011/08/17/2143119.htmlhttp://blog.csdn.net/simpson910/article/details/7941964类别@interface ClassName ( CategoryName )// method declarations@end注意事项1:类别是类的扩展,只可以声明方法,不可以声明变量。并且,类别的方法优先级较高,可覆盖原类方法。2:类别的方法中,不可以调用super方法。--类别 阅读全文
posted @ 2013-01-21 12:04 penn-wang 阅读(787) 评论(0) 推荐(1)
可点击的uiimageview
摘要:实现这个有很多方法,来看看我的小把戏。嘿嘿。代码:ClickImageView.h@interface ClickImageView : UIImageView{ id _target; SEL _selector;}-(void)addTarget:(id)target selector:(SEL)selector;@endClickImageView.m#import "ClickImageView.h"@implementation ClickImageView- (id)initWithFrame:(CGRect)frame{ self = [super initW 阅读全文
posted @ 2013-01-15 17:34 penn-wang 阅读(161) 评论(0) 推荐(0)
同一个label 文字不同颜色
摘要:上图:不要怀疑,这是一个label。代码ColorsLabel.h@interface ColorsLabel : UILabel { NSMutableDictionary *_attributedDic; NSMutableAttributedString *_attributedText;}@property (nonatomic, copy) NSMutableDictionary *attributedDic;@endColorsLabel.m#import <CoreText/CoreText.h>#import "ColorsLabel.h"#im 阅读全文
posted @ 2013-01-15 17:22 penn-wang 阅读(526) 评论(0) 推荐(0)
ios百度地图 libs
摘要:1.将API的libs文件夹拷贝到您的Application工程跟目录下2.在XCode的Project -> Edit Active Target -> Build -> Linking -> Other Linker Flags中添加-all_load3.设置静态库的链接路径,在XCode的Project -> Edit Active Target -> Build -> Search Path -> Library Search Paths中添加您的静态库目录,比如"$(SRCROOT)/../libs/Release$(EFFE 阅读全文
posted @ 2013-01-11 13:55 penn-wang 阅读(260) 评论(0) 推荐(0)
键盘 切换中英文输入 事件
摘要:#pragma -mark -keyBoardNotification- (void)addNotification {// if(IOS_VERSION<5.0)// {// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil];// [[NSNotificationCenter defaultCenter] addObse... 阅读全文
posted @ 2013-01-10 15:15 penn-wang 阅读(430) 评论(0) 推荐(0)
UIScrollView做引导页,滚动到最后一页,继续滚动,,处理。。
摘要:- (void) scrollViewDidEndDecelerating:(UIScrollView *)scrollView{ int index = fabs(_theScrollView.contentOffset.x)/self.view.frame.size.width; if(_lastPageIndex == index) { _lastPageIndex++; } else{ _lastPageIndex = index; } if (_lastPageIndex>index){ //在这里,就是已经在最后一页,... 阅读全文
posted @ 2013-01-10 10:31 penn-wang 阅读(703) 评论(0) 推荐(0)
自定义数据结构的copy
摘要:比如,我自定义someData;@interface someData : NSObject<NSCopying> { NSString *_aStr; UIColor *_aColor;}@property (nonatomic, copy) NSString *aStr;@property (nonatomic, retain) UIColor *aColor;@end////@implementation someData@synthesize aStr = _aStr;@synthesize aColor = _aColor;-(void) dealloc { [_a... 阅读全文
posted @ 2012-12-26 11:36 penn-wang 阅读(147) 评论(0) 推荐(0)
release 的一点疑问
摘要:@property (nonatomic, retain) UIView *testView;@synthesize testView = _testView;大家都知道,这是系统默认的 setter和getter方法。其具体实现,如setter:- (void)setTestView:(UIView *)testView { if (testView == _testView) { return; } [_testView release]; _testView = [testView retain];}疑问在这里:如果调用 self.testView = someView;进入 setTe 阅读全文
posted @ 2012-12-18 15:18 penn-wang 阅读(135) 评论(0) 推荐(0)
IOS Plist操作
摘要:代码:copy BUNDLE下的plist文件 到 library下面。bundle下不支持些,library,doc路径支持读与写。+ (void)copyUserpigListToLibrary { NSFileManager *fileManager = [NSFileManager defaultManager]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); NSString *libraryDirectory = [p... 阅读全文
posted @ 2012-11-30 16:08 penn-wang 阅读(181) 评论(0) 推荐(0)
IOS 属性 nonatomic atomic copy retain
摘要:NO.1属性 @property 系统生成的对于成员变量的set和get方法。@property (nonatomic,retain) UIImage *myImage; @synthesizemyImage = _myImage;<1>retain 、copy、assign IOS为计数器内存管理机制。当且仅当 retainCount==0,内存释放。 retain作用:使同一块内存的retainCount+1;NSObject * o = [[NSObject alloc] init]; NSObject *v = [o retain]; 则o和v的retainCount同为 阅读全文
posted @ 2012-11-29 15:42 penn-wang 阅读(276) 评论(0) 推荐(0)