Objective C
文章平均质量分 55
alexjames_83
这个作者很懒,什么都没留下…
展开
-
NSDateFormatter 调整时间格式
// 2012年01月18日 将输出 01/18/12 NSDate *today = [NSDate dateWithTimeIntervalSinceNow:0]; NSDateFormatter *dateFormat = [[[NSDateFormatter alloc] init] autorelease]; [dateFormat setDateStyle:NSDateForm原创 2012-01-18 17:58:41 · 820 阅读 · 0 评论 -
Side Project - CarnaVote
对了,在2013年的最后一个月,用了1周业余时间从后台到应用,纯手工打造的一款应用,Android和iOS上都有。不过是荷兰语的。。。这是一个当地嘉年华的导航应用,目前还处在摸索阶段,v1.0而已,今年试试水,计划明年问商户和组织者收钱。(不过明年的事情谁都不知道,怎么TMD感觉会很悲催。)http://carnavote.appapp.me/iOS版应用下载地址:https://原创 2014-02-07 23:16:01 · 1002 阅读 · 0 评论 -
Side Project - 愛羽球 v1.2.4 提交了
现在加载商品列表时再也不会担心崩溃的问题了 接下来还计划着做更多的功能:首先要解决的是视频不能横屏播放的问题,这个太丢人了!原创 2014-02-07 23:39:42 · 1018 阅读 · 0 评论 -
MD5 加密 Objective C
在Objective C中如何进行MD5加密,代码如下:#import "MyExtensions.h"#import // Need to import for CC_MD5 access@implementation NSString (MyExtensions)- (NSString *) md5{ const char *cStr = [self UTF8Strin原创 2012-05-25 17:07:35 · 5684 阅读 · 0 评论 -
自定义UINavigationBar的背景图片
对于iOS5.0以下可以使用以下办法:UINavigationBar+CustomImage.h#import @interface UINavigationBar (CustomImage)- (void)drawRect:(CGRect)rect;@endUINavigationBar+CustomImage.m#import "UINavigationBar+Cust原创 2012-05-14 09:08:08 · 2580 阅读 · 0 评论 -
关闭UITableView cell的被选中效果
可以使用以下任意一种办法cell.selectionStyle = UITableViewCellSelectionStyleNone;[cell setSelectionStyle:UITableViewCellSelectionStyleNone];原创 2012-05-14 09:04:34 · 23586 阅读 · 0 评论 -
如何判断NSString是数值类型
#import intmain(int argc, char* argv[]){ NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSLocale *l_en = [[NSLocale alloc] initWithLocaleIdentifier: @"en_US"]; NSLocale *l原创 2012-05-09 10:46:35 · 1502 阅读 · 1 评论 -
iOS Local Notification学习笔记
做了很多有Push Notification和Locale Notification的app,来整理下开发的笔记。今天先说说Local Notification在iOS4.0后Apple加入了Local Notification。这里是NSLocaleNotification的Class Reference http://developer.apple.com/library/ios/#doc原创 2012-04-21 13:35:23 · 11642 阅读 · 1 评论 -
auto release pool 应该用release还是drain
文档里是这么说的:drainIn a reference-counted environment, releases and pops the receiver; in a garbage-collected environment, triggers garbage collection if the memory allocated since the last collect原创 2012-05-04 17:18:25 · 1736 阅读 · 0 评论 -
在[super dealloc]前释放对象
如题正确做法:- (void)dealloc { [viewController release]; [window release]; [super dealloc];}错误做法- (void)dealloc { [super dealloc]; [viewController release]; [window releas原创 2012-05-03 13:29:51 · 2528 阅读 · 0 评论 -
判断一个NSString是否包含一个Substring
NSRange textRange;textRange =[string rangeOfString:substring]; if(textRange.location != NSNotFound){//包含}原创 2012-04-20 14:51:29 · 3022 阅读 · 0 评论 -
assign, copy, retain - 仔细看看怎么回事
用@property不就完了么,为啥要自己写Getter和Setter?有些时候需要在getter和setter方法中加入些特别的操作。最简单的getter和setter- (SomeVariable)someValue{ return someValue;}- (void)setSomeValue:(SomeVariable)aSomeVariableVa原创 2012-05-02 20:50:58 · 1842 阅读 · 0 评论 -
[iOS学习笔记]超级快的JSONKit
ParsingSerializing23% Faster than Binary .plist !549% Faster than Binary .plist !解析和序列化的速度比其他JSON库快很多!这里是Github的链接:https://github.com/johnezang/JSONKitNSData Interface原创 2012-04-24 17:54:30 · 2768 阅读 · 0 评论 -
Objective C - UIColor
UIColor+Hex.h#import @interface UIColor (Hex) + (UIColor *) colorWithHexString: (NSString *) hexString;+ (CGFloat) colorComponentFrom: (NSString *) string start: (NSUInteger) start length: (原创 2014-10-29 14:17:11 · 2195 阅读 · 0 评论