06 2013 档案

摘要:- (NSDate *)jsDateFromBeginDate:(NSDate *)beginDate todays:(int)days{ NSDate *dateTemp = [[NSDate alloc]init]; NSTimeInterval interval = 24*60*60*days; dateTemp = [dateTemp initWithTimeInterval:interval sinceDate:beginDate]; return dateTemp;} NSDateFormatter * dateFormatter= [[[NSDa... 阅读全文
posted @ 2013-06-25 19:36 cocoajin 阅读(3326) 评论(0) 推荐(0) 编辑
摘要:方法一: 可以用nsdate 的 timeIntervalSince1970 方法把时间转换成时间戳进行比较,这里timeIntervalSince1970返回的是NSTimeInterval(double)类型,直接比较就可以了方法二:使用nsdate的compare方法实现- (BOOL)date:(NSDate*)date isBetweenDate:(NSDate*)beginDate andDate:(NSDate*)endDate{ if ([date compare:beginDate] == NSOrderedAscending) return NO; ... 阅读全文
posted @ 2013-06-24 17:38 cocoajin 阅读(660) 评论(0) 推荐(0) 编辑
摘要:iPhone-only AppsInclude the following in your application's Resources group in the Xcode project:Table 1iPhone-only apps icon requirements.Image Size (px)File NameUsed ForRequired Status512x512iTunesArtworkAd Hoc iTunesOptional but recommended57x57Icon.pngApp Store and Home screen on iPhone/iPod 阅读全文
posted @ 2013-06-21 13:08 cocoajin 阅读(567) 评论(0) 推荐(0) 编辑
摘要:在icon默认情况: 程序的图标会被apple进行美化, 自动圆角, 加上阴影和反光效果;如果不想要这种效果:在Info.plist中添加一个Icon already includes gloss effects并选择YES. 阅读全文
posted @ 2013-06-21 12:36 cocoajin 阅读(418) 评论(0) 推荐(0) 编辑
摘要:Advantages:Makes setFrame ofUIPickerViewbehave like it shouldNo transform code within yourUIViewControllerWorks withinviewWillLayoutSubviewsto rescale/position theUIPickerViewWorks on the iPad withoutUIPopoverThe superclass always receives a valid heightWorks with iOS 5Disadvantages:Requires you to 阅读全文
posted @ 2013-06-20 19:02 cocoajin 阅读(3251) 评论(0) 推荐(0) 编辑
摘要:代码方法://日期阳历转换为农历;- (NSString *)convertDateToNongLi:(NSString *)aStrDate{ NSDate *dateTemp = nil; NSDateFormatter *dateFormater = [[NSDateFormatter alloc]init]; [dateFormater setDateFormat:@"yyyy-MM-dd"]; dateTemp = [dateFormater dateFromString:aStrDate]; NSCalendar* calendar = [[N... 阅读全文
posted @ 2013-06-20 18:42 cocoajin 阅读(2053) 评论(0) 推荐(0) 编辑
摘要:一: // UIButton *editSome; 为全局变量,已开启ARC; editSome = [UIButton buttonWithType:UIButtonTypeCustom]; editSome.frame = kCCR(0, 0, 45, 25); [editSome setTitle:@"编辑" forState:UIControlStateNormal]; [editSome setTitleColor:[UIColor whiteColor] forState:UIControlStateNor... 阅读全文
posted @ 2013-06-20 12:00 cocoajin 阅读(912) 评论(0) 推荐(0) 编辑
摘要:一:引入包和头文件; 需要在frameworks中添加QuartzCore.framework 在接口程序中加上头文件 #import <QuartzCore/QuartzCore.h>二:使用 CATransition *myAnimation = [CATransition animation]; myAnimation.duration = 0.8f; myAnimation.type = kCATransitionPush; myAnimation.subtype = kCATransitionFromBottom; [self.navigat... 阅读全文
posted @ 2013-06-20 10:35 cocoajin 阅读(473) 评论(0) 推荐(0) 编辑
摘要:思路: 写一个 UILbel的子类;在子类里面重新布置UILbel的字体间距;如代码 .h#import <UIKit/UIKit.h>@interface AdjustableUILable : UILabel{ CGFloat characterSpacing;}@property CGFloat characterSpacing;@end 代码 .m#import "AdjustableUILable.h"@implementation AdjustableUILable@synthesize characterSpacing;- (id)initWith 阅读全文
posted @ 2013-06-18 13:25 cocoajin 阅读(1154) 评论(0) 推荐(0) 编辑
摘要:label.font=[UIFontfontWithName:@"Arial-BoldItalicMT"size:24];字体名如下:Font Family: American TypewriterFont: AmericanTypewriterFont: AmericanTypewriter-BoldFont Family: AppleGothicFont: AppleGothicFont Family: ArialFont: ArialMTFont: Arial-BoldMTFont: Arial-BoldItalicMTFont: Arial-ItalicMTFont 阅读全文
posted @ 2013-06-18 12:55 cocoajin 阅读(314) 评论(0) 推荐(0) 编辑
摘要:方案一: [self.tableView setAllowsSelection:NO];方案二: [cell setSelectionStyle:UITableViewCellSelectionStyleNone]; 阅读全文
posted @ 2013-06-18 11:14 cocoajin 阅读(182) 评论(0) 推荐(0) 编辑
摘要:方法一: [historyTodayTableVC setSeparatorStyle:UITableViewCellSeparatorStyleNone];方法二: [historyTodayTableVC setSeparatorColor:[UIColor clearColor]];注意:historyTodayTableVC 为当前的 tableView; 阅读全文
posted @ 2013-06-18 10:53 cocoajin 阅读(521) 评论(0) 推荐(0) 编辑
摘要://适用于调试代码,当程序执行出错时,程序立即停止,并抛出异常; //这是一个宏 --称之为 断言; int x = 1; NSAssert(x!=0, @"**********************不能为0"); /* 1: 如上代码,当 !=0时,不会打印上述 不能为0; 2:当 x=0 时,就会打印上述信息,并程序立即抛出异常; */内部实现--------- #define NSAssert(condition, desc, ...) \ do { \ __PRAGMA_PUSH_NO_EXTRA_ARG_W... 阅读全文
posted @ 2013-06-05 17:00 cocoajin 阅读(222) 评论(0) 推荐(0) 编辑
摘要:1. iOS APP Project or Mac APP Project编译错误提示:“The run destination My Mac 64-bit is not valid for Running the scheme '***'.The scheme '***' contains no buildables that can be built for the SDKs supported by the run destination My Mac 64-bit. Make sure your targets all specify SDKs that 阅读全文
posted @ 2013-06-03 21:40 cocoajin 阅读(251) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示