摘要: 基本使用: void (^vFun)()=^(void){ NSLog(@"void function"); }; vFun();//void function //void:返回类型 //(^vFun):vFun代表函数名 //(xx):传入参数的类型,为空代表木有参数 //^(xxx):block格式,xxx代表传入参数 int (^iFun)(int) = ^(int i){ return i; }; NSLog(@"%d",iFun(12345));//12345 NSString *str ... 阅读全文
posted @ 2012-05-28 09:58 Maxfong 阅读(1357) 评论(0) 推荐(0) 编辑
摘要: http://wiki.magiche.net/很详细的教材,完全参考了。后续更新自己的理解。 阅读全文
posted @ 2012-05-22 14:57 Maxfong 阅读(184) 评论(0) 推荐(1) 编辑
摘要: 使用方法简单,说明文档很详细。给UIAlertView增加扩展方法,使它支持多按钮。按钮事件通过BlocksRIButtonItem *cancelItem = [RIButtonItem item];cancelItem.label = @"No";cancelItem.action = ^{//...};RIButtonItem *deleteItem = [RIButtonItem item];deleteItem.label = @"Yes";deleteItem.action = ^{//...};UIAlertView *alertView 阅读全文
posted @ 2012-05-21 15:47 Maxfong 阅读(323) 评论(0) 推荐(0) 编辑
摘要: 1.介绍:http://www.xiangwangfeng.com/2.安装:行之有效的方法 1.自动:http://www.99css.com/ 2.手动:http://gaobusi.iteye.com/3.这个app参考了samples里的TTCatalog、TTNavigatorDemo,实现3个页面,功能: 1.Navigator的左右分别添加TTMessage和TTPost,View显示一个经过TTDefaultStyleSheet修改的text和一个image; 2.3个Scroll分别包含各种样式的Button、各种样式的TextField、2款Tabb... 阅读全文
posted @ 2012-05-21 15:39 Maxfong 阅读(720) 评论(1) 推荐(1) 编辑
摘要: 方向感应:在ImageViewController.h中添加UIAccelerometerDelegate:@interface ImageViewController : UIViewController<UIImagePickerControllerDelegate, UINavigationControllerDelegate, UIAccelerometerDelegate>{//...ImageViewController.m文件内,初始化UIAccelerometer,在viewWillAppear:animated中:- (void)viewWillAppear:(B 阅读全文
posted @ 2012-05-16 09:22 Maxfong 阅读(324) 评论(0) 推荐(0) 编辑
摘要: url:samvermette_SVWebViewControllerThree20带此浏览方式,如果只需要单一功能,不需要添加整个320项目。源码包demo方法:- (void)pushWebViewController { NSURL *URL = [NSURL URLWithString:@"http://www.cnblogs.com/maxfong/"]; SVWebViewController *webViewController = [[SVWebViewController alloc] initWithURL:URL]; [self.navigationC 阅读全文
posted @ 2012-05-15 14:01 Maxfong 阅读(4787) 评论(0) 推荐(0) 编辑
摘要: 添加AVFoundation.framework 和MediaPlayer.framework。在NavView.h文件中,添加:#import<AVFoundation/AVFoundation.h>#import<MediaPlayer/MediaPlayer.h>@interfaceNavView1:UIViewController<AVAudioPlayerDelegate>{AVAudioPlayer*audioPlayer;MPMoviePlayerController*moviePlayer;}@end在init中添加音乐url:-(id)in 阅读全文
posted @ 2012-05-14 13:25 Maxfong 阅读(541) 评论(0) 推荐(0) 编辑
摘要: nav添加左按钮:-(void)viewDidLoad{//...UIBarButtonItem*tableEditBtn=[[UIBarButtonItemalloc]initWithBarButtonSystemItem:UIBarButtonSystemItemEdittarget:selfaction:@selector(toggleEdit:)];[[selfnavigationItem]setLeftBarButtonItem:tableEditBtn];[tableEditBtnrelease];}edit按钮的实现:-(void)toggleEdit:(id)sender{i. 阅读全文
posted @ 2012-05-10 09:27 Maxfong 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 归档TableViewController的data。为了在Nav上添加Add按钮,为TableViewController创建UINavigationController://FirstAppAppDelegate.h@classTableViewController;@interfaceFirstAppAppDelegate:NSObject<UIApplicationDelegate>{TableViewController*tableTab;//为了能执行数据保存}//FirstAppAppDelegate.m内,不详细写-(BOOL)application:(UIAppl 阅读全文
posted @ 2012-05-09 14:04 Maxfong 阅读(433) 评论(0) 推荐(0) 编辑
摘要: 添加Rotation文件,用类别为UITabBarController添加旋转://Rotation.h文件#import<Foundation/Foundation.h>@interfaceUITabBarController(Rotation)-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)x;@endRotation.m文件:#import"Rotation.h"@implementationUITabBarController(Rotation)-(BOOL)sh 阅读全文
posted @ 2012-05-08 09:38 Maxfong 阅读(209) 评论(0) 推荐(0) 编辑