ios学习笔记
来源:互联网 发布:电脑天猫,淘宝怎么删除 编辑:程序博客网 时间:2024/05/22 00:11
ActionSheet:
头文件里加<UIActionSheetDelegate>协议。
- (IBAction)buttonPressed:(id)sender { UIActionSheet *actionSheet = [[UIActionSheet alloc] initWithTitle:@"Are you sure?" delegate:self cancelButtonTitle:@"No Way!" destructiveButtonTitle:@"Yes, I’m Sure!" otherButtonTitles:nil]; [actionSheet showInView:self.view];}- (void)actionSheet:(UIActionSheet *)actionSheetdidDismissWithButtonIndex:(NSInteger)buttonIndex{ if (buttonIndex != [actionSheet cancelButtonIndex]) { NSString *msg = nil; if (nameField.text.length > 0) msg = [[NSString alloc] initWithFormat: @"You can breathe easy, %@, everything went OK.", nameField.text]; else msg = @"You can breathe easy, everything went OK."; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Something was done" message:msg delegate:self cancelButtonTitle:@"Phew!" otherButtonTitles:nil]; [alert show]; }}
从plist里读数据【08 - Sections】:
@property (strong, nonatomic) NSDictionary *names;@property (strong, nonatomic) NSArray *keys;NSString *path = [[NSBundle mainBundle] pathForResource:@"sortednames" ofType:@"plist"]; NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path]; self.names = dict; NSArray *array = [[names allKeys] sortedArrayUsingSelector: @selector(compare:)]; self.keys = array;
是否iphone5
#define iPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
- iOS UIResponder 学习笔记
- ios学习笔记
- iOS 学习笔记
- IOS学习笔记
- ios学习笔记(转)
- ios MapKit学习笔记
- IOS学习笔记1
- ios学习笔记
- IOS UITableView 学习笔记
- IOS学习笔记3
- IOS MapKit学习笔记
- iOS学习笔记
- IOS 学习笔记
- ios学习笔记
- ios学习笔记 UIAlertView
- iOS Runtime 学习笔记
- IOS学习笔记-概述
- iOS学习笔记20131120
- 专业单词
- android使用AppWidget
- http://blog.csdn.net/ciaos/article/details/7745979
- 什么叫代码覆盖率
- 【笔试题】一种树形结构--递归赋值(。。。)
- ios学习笔记
- C++隐藏任意进程,目录/文件,注册表,端口
- 修复被设置为unused的字段
- LINUX驱动——内核源码树构建
- 使用正则表达式解析URL
- hdu 2993 MAX Average Problem 动态规划 斜率优化
- MATLAB产生一个设定比例0和1的随机数数组的方法
- 哈工大 排序、查找算法 1003
- Linux .o a .so .la .lo的区别