摘要:
@interface ViewController () <AddViewControllerDelegate> @property (nonatomic, retain) UITableView *tableView; @property (nonatomic, retain) NSMutable 阅读全文
摘要:
@interface ViewController () @property (nonatomic, retain) NSMutableArray *dataArrary; @property (nonatomic, retain) NSMutableArray *dogArray; @proper 阅读全文
摘要:
-(instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { //获取整体宽高 CGFloat totalWidth = frame.size.width; CGFloat t 阅读全文
摘要:
/** * 1、如何定义一个Block变量 2、怎样给定义的Block变量赋初值 3、如何重定义Block类型 4、如何使用Block实现具体的功能 5、Block与变量作用域的关系 */ int sum(int a, int b) { return a + b; } int count = 100 阅读全文
摘要:
#import "FirstViewController.h" #import "SecondViewController.h" @interface FirstViewController () @end @implementation FirstViewController - (void)de 阅读全文
摘要:
- (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = @"朱珍洁"; self.view.backgroundColor = [UIColor purpleColor]; UIButton *button = [ 阅读全文
摘要:
- (void)dealloc { [_scrollView release]; [_pageControl release]; [super dealloc]; } - (void)scrollViewDidScroll:(UIScrollView *)scrollView { //获取滚动视图当 阅读全文
摘要:
//滚动过程中触发的方法 - (void)scrollViewDidScroll:(UIScrollView *)scrollView { NSLog(@"正在滚动"); } //即将开始拖拽的方法,此时滚动视图即将加速 - (void)scrollViewWillBeginDragging:(UI 阅读全文
摘要:
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. UIImageView *imageView = [[UIImageView alloc] initWithFr 阅读全文
摘要:
- (void)viewDidLoad { [super viewDidLoad]; UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(50, 50, 275, 500)]; imageView.image 阅读全文
摘要:
/* 1. 新建一个空模板的工程,将环境配置为MRC,四步走 2. 新建一个视图控制器,将此视图控制器指定为widow的根视图控制器 3. 自定义视图LTView,明确LTView内部的控件,声明为属性,重写initwithFrame:布局方法,先将子视图加上去,完成显示效果,需要再去定义一个初始化 阅读全文
摘要:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWi 阅读全文
摘要:
//加载根视图的方法,我们通常在这个方法中,指定根视图为我们想要的某个视图 //并且在一个视图控制器的生命周期,此方法只会走一次。 //在加载方法中,不能使用self.view这个getter方法获取根视图,因为此时根视图正在加载,并没有真实存在。 - (void)loadView { //创建lo 阅读全文
摘要:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWi 阅读全文
摘要:
/** * 1、创建完空模板之后,修改环境为MRC 2、将AppDelegate.h文件中的strong改为retain 3、在AppDelegate.m文件中重写dealloc 方法将实例变量_window释放一次 4、在创建window对象的最后加autorelease,完成内存管理。 */ - 阅读全文