摘要: //通过点击事件自动轮换隐藏和显示导航栏- (void)clickimage:(id)sender{ BOOL navBarState = [self.navigationController isNavigationBarHidden];//获取当前的导航栏是否隐藏 [self.navigationController setNavigationBarHidden:!navBarState animated:YES]; [self.navigationController setToolbarHidden:!navBarState animated:YES]; if ... 阅读全文
posted @ 2012-05-13 15:32 FoxBabe 阅读(775) 评论(0) 推荐(1) 编辑
摘要: 在现在的ios sdk中,我们一般通过UIApplication的setStatusBarOrientation:来进行View的强制旋转(当然,还要配合- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation),但是,setStatusBarOrientation并不一定马上会执行shouldAutorotateToInterfaceOrientation进行界面旋转,这时,有个小技巧可以让界面马上旋转过来,那就是调用一下 UINavigationController 阅读全文
posted @ 2012-05-13 15:27 FoxBabe 阅读(348) 评论(0) 推荐(1) 编辑
摘要: #import <Foundation/Foundation.h>@interface Base64Code : NSObject+ (NSString * )encodeBase64:(NSString * )input;//加密+ (NSString * )decodeBase64:(NSString * )input;//解密@end #import "Base64Code.h"#import "GTMBase64.h"@implementation Base64Code//加密+ (NSString * )encodeBase64:( 阅读全文
posted @ 2012-05-13 15:16 FoxBabe 阅读(494) 评论(0) 推荐(1) 编辑
摘要: //// Histogram.h// CGraph//// Created by Fox on 12-4-16.// Copyright 2012 __MyCompanyName__. All rights reserved.////绘制柱状图#import <UIKit/UIKit.h>#define kindex 4@interface Histogram : UIView { CGFloat colors[kindex][4];//每一个柱状图的颜色 CGRect rects[kindex];//每一个柱状图的大小形状 CGContextRef canvas; CGFloat 阅读全文
posted @ 2012-05-13 15:02 FoxBabe 阅读(413) 评论(0) 推荐(1) 编辑
摘要: //// ViewController.m// RunLoopDemo//// Created by Fox on 12-5-13.// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.//#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad{ [super viewDidLoad]; //使用NSTimer创建定时器 NSTimeInt... 阅读全文
posted @ 2012-05-13 14:49 FoxBabe 阅读(480) 评论(0) 推荐(1) 编辑
摘要: 创建线程有三种方法:一、通过[NSThread detachNewThreadSelector:@selector(addAction) toTarget:self withObject:nil]创建,无具体的返回对象,线程不受用户控制,控制权掌握在系统的手中;二、通过[[NSThread alloc] initWithTarget:self selector:@selector(addNumberTo:) object:maxNumber]创建,通过该方式创建的线程由用户自己管理;三、自定义线程,通过继承NSThread来实现。//// ViewController.m// Thread.. 阅读全文
posted @ 2012-05-13 14:46 FoxBabe 阅读(312) 评论(0) 推荐(1) 编辑