![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
iOS
iteye_2768
这个作者很懒,什么都没留下…
展开
-
视图切换的方式
1、利用NavigationController切换 切换: - (void)pushViewController:(UIViewController *)viewController animated:(BOOL)animated; 返回: - (UIViewController *)popViewControllerAnimated:(BOOL)animated; 2...原创 2013-11-01 15:59:24 · 307 阅读 · 0 评论 -
判断网络是否连接
iOS开发中判断网络连接的操作步骤如下: 1、添加framework,SystemConfiguration.framework; 2、倒入文件: #import <SystemConfiguration/SystemConfiguration.h> #include <netdb.h> 3、判断方法: - (BOOL) connectedToNetwork...原创 2013-11-07 17:32:06 · 150 阅读 · 0 评论 -
扩展UIDevice来监测网络连接
《The iPhone Developer's Cookbook》 没什么好说的,直接上代码: 1、UIDevice+Reachability.h: #import <UIKit/UIKit.h> @interface UIDevice (Reachability) + (BOOL) networkAvailable; + (BOOL) activeWLAN; + (...原创 2013-11-07 17:40:24 · 148 阅读 · 0 评论 -
layoutSubviews调用时机
原文:以下情况下会被调用: 1、init初始化不会触发layoutSubviews; 2、addSubview会触发layoutSubviews; 3、设置view的Frame会触发layoutSubviews,当然前提是frame的值设置前后发生了变化; 4、滚动一个UIScrollView会触发layoutSubviews; 5、旋转Screen会触发父UIView上的layou...原创 2014-04-01 13:14:04 · 159 阅读 · 0 评论 -
iOS后台运行示例代码
iOS获取有限的后台运行时间 // AppDelegate.h文件 @property (assign, nonatomic) UIBackgroundTaskIdentifier backgroundUpdateTask; // AppDelegate.m文件 - (void)applicationDidEnterBackground:(UIApplication *...原创 2014-08-21 14:23:41 · 281 阅读 · 0 评论 -
使用系统默认UITableViewCell使用时的heightForRowAtIndexPath:indexPath方法
iOS项目开发中使用系统默认的UITableViewCell时,Delegate中的方法- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath;须慎用。 项目中使用系统默认的UITableViewCell: - (UITableViewCell *)t...原创 2014-10-13 14:13:10 · 262 阅读 · 0 评论