将文件放入项目中(文件名不能为中文)
NSString *fileNameStr = @"Authorization";
NSString *path = [[NSBundle mainBundle] pathForResource:fileNameStr ofType:@"doc"];
NSString *encodedString = [path stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];
NSURL *url = [NSURL fileURLWithPath:encodedString];
NSArray *dataAry = @[url];
UIActivityViewController *activityController=[[UIActivityViewController alloc]initWithActivityItems:dataAry applicationActivities:nil];
[self.navigationController presentViewController:activityController animated:YES completion:nil];
网友评论