#import <UIKit/UIKit.h>
#import <QuickLook/QuickLook.h> @interface ViewController : UIViewController<QLPreviewControllerDataSource>
- (IBAction)click:(id)sender; @end
#import "ViewController.h"

@interface ViewController ()

@end

@implementation ViewController

- (void)viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view, typically from a nib.
} - (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
} - (IBAction)click:(id)sender {
//第一步 实例化对象
QLPreviewController *QL=[[QLPreviewController alloc] init];
QL.dataSource=self;
QL.currentPreviewItemIndex=;
[self presentViewController:QL animated:YES completion:^{ }]; [QL release];
} - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
} //第二 实习代理方法
- (NSInteger)numberOfPreviewItemsInPreviewController:(QLPreviewController *)controller{
return ;
} /*!
* @abstract Returns the item that the preview controller should preview.
* @param panel The Preview Controller.
* @param index The index of the item to preview.
* @result An item conforming to the QLPreviewItem protocol.
*/
- (id <QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index{ return [NSURL fileURLWithPath:@"/Users/zy/Desktop/2013下半年岗位培训需求.xlsx"];
} @end

参考文章 http://61.177.61.252:80/szzssw/taxCommon.action?code=1101&id=dc54f6cb87824bbe8b3d3ae1a755f1e2

最新文章

  1. your password has expired.to log in you must change it
  2. 每日Scrum(2)
  3. Unity3D FPS帧数修改
  4. Linux下命令行安装配置android sdk
  5. 最清晰的Android多屏幕适配方案
  6. Codeforces Round #345 D. Image Preview(二分)
  7. Nodejs Buffer
  8. mysql 常用操作(整理)
  9. 更改VisualStudio默认创建类和接口不加public问题
  10. c++ 数据持久层研究(一)
  11. Python之Socket&amp;异常处理
  12. C#代码生成工具:文本模板初体验 使用T4批量修改实体框架(Entity Framework)的类名
  13. 清除冗余的css
  14. JQuery案例二:实现全选、全不选和反选
  15. Python量化分析,计算KDJ
  16. linux rescue 修复引导 与linux下修复windows引导
  17. cocos2dx渲染架构
  18. arping 帮助——翻译
  19. Bootstrap:教程、简介、环境安装
  20. CryptoJS与C#AES加解密互转

热门文章

  1. Asp.net Page_ClientValidate 的应用和跳过
  2. MySQL 高可用性—keepalived+mysql双主(有详细步骤和全部配置项解释)
  3. vue路由跳转传参数
  4. JQuery实现可编辑的表格
  5. 我的四轴专用PID参数整定方法及原理---超长文慎入(转)
  6. Ubuntu通过 lshw 工具包查看物理网卡名称
  7. (转)Unity3D研究院之Assetbundle的实战(六十三)
  8. [Spring Boot] Introduce to Mockito
  9. ecshop二次开发 使用ecshop电子商务系统的100个小问题
  10. ActiveMQ持久化方式