`
zcw_java
  • 浏览: 297214 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论
文章列表
节省大量内存,重绘缩略图; #define K_contentsOfFile(fileName,fileType) [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:fileName ofType:fileType]] 3种方法,分别是调整、居中、填充方式。 1、等比例缩放。需要根据图像的长宽比在其四周留出一些额外区域,用透明像素为图像消关。 + (CGSize) fitSize: (CGSize)thisSize inSize: (CGSize) aSize {     CGFloat scal ...
如何用Facebook graphic api上传视频: http://developers.facebook.com/blog/post/532/ Keychain保存数据封装: https://github.com/carlbrown/PDKeychainBindingsController 对焦功能的实现: http://www.clingmarks.com/?p=612 自定义圆角Switch按件: https://github.com/domesticcatsoftware/DCRoundSwitch 弹出窗口For iphone and ipad: https:// ...
1,command+b  build一下工程 2,Debug-iphoneos和Debug-iphonesimulator文件下都会出现一个.a文件 3,将Debug-iphonesimulator中重命名xxx_i386.a 4,将两个文件都拷贝到一个目录下,打开终端 5, xxxiMac:111 Ken$ lipo -info libupnpx_i386.a input file libupnpx_i386.a is not a fat file Non-fat file: libupnpx_i386.a is architecture: i386 KenzhaotekiiMac:111 ...
添加到选中cell中,每一个cell闪烁1秒 [tableView deselectRowAtIndexPath:indexPath animated:YES]; 设置cell背景色和背景图 UIView *backgrdView = [[UIView alloc] initWithFrame:cell.frame]; backgrdView.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"tabCell_background.png"]]; cell.background ...
最重要的下面几行代码 - (void) clickRightBarItem { NSInteger row0 = [m_pickerSetupAlarmDate selectedRowInComponent:0]; NSInteger row1 = [m_pickerSetupAlarmDate selectedRowInComponent:1]; NSInteger row3 = [m_pickerSetupAlarmDate selectedRowInComponent:3]; NSInteger row4 = [m_pickerSetupAla ...
制作圆角button等 //必须导入的空间 #import<QuartzCore/QuartzCore.h> 就拿view来举例 view.layer.masksToBounds=YES; //设置为yes,就可以使用圆角 view.layer.cornerRadius= 5; //设置它的圆角大小 view.layer.borderWidth=1; //视图的边框宽度 view.layer.borderdg= [[UIdggray dg].CGdg]; //视图的边框颜色 制作阴影NavBar稍后附上代码 按钮从A点平滑到B点 + (void) ...
NSString 两个字符串的比较,用 a compare:b 来比,得出的结果分3种 1. 26个字母比较 越靠后面 越大 NSString *a = @"qweqwe"; NSString *b = @"qweasd"; BOOL result = [a compare:b]; if (result == NSOrderedSame) { // NSOrderedSame = 0 完全一样 NSLog(@"a = b"); }e ...
[self.navigationController setNavigationBarHidden:YES]; self.navigationController.hidesBottomBarWhenPushed = YES; //这句是隐藏tabbar 返回时 先[self.navigationController setNavigationBarHidden:NO]; 或在前一页面的viewWillAppear中加入 [self.navigationController setNavigationBarHidden:NO];

使用模态视图

 
下面两个是模态视图两个动画的参数,设置的时候可以写成 self.modalPresentationStyle = 1; [self presentModalViewController:navSetWireless animated:YES]; //modalTransitionStyle跟modalPresentationStyle相互对应 modalTransitionStyle UIModalTransitionStyleCoverVertical UIModalTransitionStyleFlipHorizontal ...
1,创建一个新的子线程 //在分线程中操作 [NSThread detachNewThreadSelector:@selector(saveUserData) toTarget:self withObject:nil]; 2,如果不在主线程中,将其加入主线程 //如果当前非主线程,将其加入主线程 if (![NSThread isMainThread]) { [self performSelectorOnMainThread:@selector(loginSuccess) withObject:nil waitUntilDone:NO]; ...
一:确认网络环境3G/WIFI     1. 添加源文件和framework         开发Web等网络应用程序的时候,需要确认网络环境,连接情况等信息。如果没有处理它们,是不会通过Apple的审(我们的)查的。     Apple 的 例程 Reachability 中介绍了取得/检测网络状态的方法。要在应用程序程序中使用Reachability,首先要完成如下两部:         1.1. 添加源文件:     在你的程序中使用 Reachability 只须将该例程中的 Reachability.h 和 Reachability.m 拷贝到你的工程中。如下图:       ...
首先,app如果要上app store是没有办法获取wifi列表的~ 这些WIFI扫描软件使用了苹果的私有函数apple80211.framework 尽管不能合法(指能通过App Store的审核)的获取WIFI列表, 不过我们还是可以获取到当前Wifi连接的信息,比如SSID. SSID全称Service Set IDentifier, 即Wifi网络的公开名称. 苹果在IOS v4.1+版本上提供了公开的方法来获取该信息. 模拟器是无法获取的~~~ #import <SystemConfiguration/CaptiveNetwork.h> - (id)f ...
版本号的获取如下: NSString *executableFile = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleExecutableKey]; NSString *version = [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey]; 还有其它很多信息可由infoDictionary获得,以下是官方文档里的说明: information P ...
//将NSData转化为NSString NSString* str = [[NSString alloc] initWithData:response encoding:NSUTF8StringEncoding]; //将NSString 转化为NSData (NSString.h) - (NSData *)dataUsingEncoding:(NSStringEncoding)encoding; //用空格分割 NSString *str1 = @"周一 周三 周五 周六 周二 周日 周四"; NSArray *arr ...

NSTimer

启动 Timer – fire 停止 Timer – invalidate Timer设置 – isValid – fireDate – setFireDate: – timeInterval – userInfo self.m_timerTimeOut = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self ...
Global site tag (gtag.js) - Google Analytics