__狼行千里
刺骨的夜 · 共 15 篇文章
xcode5 打出支持ios5.0 的ipa
修改project-->targets-->build setiings-->Architecrures 中Architectures 为 $(ARCHS_STANDARD_32_BIT) 修改之后 可能会出现如下错误: malformed or corrupted AST file: 'Unable to load module "/Users/Lan_mac/Library/Developer/Xcode/Deri 解决方案 点击XCODE的菜单Window,然后选择Organizer,在弹出的对话框的最上面选择Projects 然后选择右边的 Delete 按钮,删除继承的数据,在编译…
2015-06-26 13:59 · iOS · 评论(0)
NSClassFromString
UIViewController *viewController = [[NSClassFromString(model.detailClassStr) alloc] init]; [self.navigationControllerpushViewController:viewController animated:YES];
2015-05-07 15:28 · UIViewController · 评论(0)
获取本地文件字节数
//获取本地文件字节数 -(long long) fileSizeAtPath:(NSString*) filePath{ NSFileManager* manager = [NSFileManagerdefaultManager]; if ([manager fileExistsAtPath:filePath]){ return [[manager attributesOfItemAtPath:filePath error:nil] fileSize]; } return 0; }
2015-04-30 12:35 · NSFileManager · 评论(0)
获取父视图的对象
- (UIViewController*)viewController { for (UIView* next = [self superview]; next; next = next.superview) { UIResponder* nextResponder = [next nextResponder]; if ([nextResponder isKindOfClass:[UIViewController class]]) { return (UIViewController*)nextResponder; } } returnnil; }
2015-04-22 10:58 · UIViewController · 评论(0)
IPAD调用摄像头 相册
ipad打开相册和调用摄像头的方法跟iPhone 不一样 用 UIPopoverController 显示 - (void) actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex{ AppDelegate *app = (AppDelegate *)[UIApplication sharedApplication].delegate; if(buttonIndex==0){ // 拍照 UIImagePickerController *picker = [[UIImagePic…
2015-01-16 17:42 · UIImagePickerController · 评论(0)
多线程NSOperationQueue
NSInvocationOperation *operation1 = [[NSInvocationOperationalloc]initWithTarget:self selector:@selector(uploadImage) object:nil]; NSInvocationOperation *operation2 = [[NSInvocationOperationalloc]initWithTarget:self selector:@selector(submitRequest) object:nil]; NSOperationQueue *queue = [[NSOperati…
2015-01-13 17:38 · NSOperationQueue · 评论(0)
键盘上添加工具栏
- (void)viewDidLoad { [super viewDidLoad]; UIToolbar *toolbar =[[UIToolbar alloc] initWithFrame:CGRectMake(0, 0, [[UIApplication sharedApplication] keyWindow].bounds.size.width, 40)]; toolbar.barStyle = UIBarStyleDefault; UIBarButtonItem *spaceItemLeft = [[UIBarButtonItem alloc] initWithBarButtonSy…
2015-01-13 17:37 · 键盘 · 评论(0)
自定义导航栏
一、全局宏定义 //系统版本号 #define SYS_VERSION [[[UIDevice currentDevice] systemVersion] floatValue] //颜色 #define UICOLORFROMRGB(rgbValue) [UIColor colorWithRed:((float)((rgbValue & 0xFF0000) >> 16))/255.0 green:((float)((rgbValue & 0xFF00) >> 8))/255.0 blue:((float)(rgbValue & 0xFF))/255.0 alpha:1.0] // 程序可用…
2015-01-12 16:53 · UINavigationController · 评论(0)
UITableView自定义cell
- (void)viewDidLoad { [super viewDidLoad]; UITableView *tableView = [[UITableView alloc] init]; tableView.frame = CGRectMake(0, 0, 320, 480); tableView.delegate = self; tableView.dataSource = self; tableView.tableFooterView = [[UIView alloc] init]; [self.view addSubview:tableView]; } //设置表格行数 -(NSI…
2015-01-12 16:28 · UITableView · 评论(0)
获取UIWebView内容的高度
#pragma mark -webViewDelegate -(void)webViewDidFinishLoad:(UIWebView *)webView{ NSInteger webHeight = webView.scrollView.contentSize.height; NSLog(@"webHeight1:%d", webHeight); if (webHeight > SCREEN_HEIGHT) { webHeight = SCREEN_HEIGHT - 108; } [webViewHeightArrayreplaceObjectAtIndex:webView.tag - …
2015-01-12 16:18 · UIWebView · 评论(0)
iPhone 调用本地相册 拍照
一、需要导入UIImagePickerControllerDelegate, UINavigationControllerDelegate 代理 二 、 @interface FaceView()<UIActionSheetDelegate,UIImagePickerControllerDelegate,UINavigationControllerDelegate> { UIButton *imageButton; } @end @implementation FaceView - (id)initWithFrame:(CGRect)frame { self = [super initWit…
2015-01-12 16:12 · UIImagePickerController · 评论(0)
监控键盘的高度
- (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self registerForKeyboardNotifications]; } return self; } - (void) registerForKeyboardNotifications { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector (keyboardWillShow:)name: UIKeyboardWill…
2015-01-12 16:05 · 键盘 · 评论(0)