我是Objective-c iPhone编程的新手.我有一个应用程序,我在UIWebView中成功显示PDF,但现在我想创建我的PDF的缩略图.我的PDF存储在我的资源文件夹中.
所以请给我一些代码,说明如何显示我的PDF缩略图.我的代码用于显示PDF是按钮功能:
-(void)show:(id)sender {
pdfView.autoresizesSubviews = NO;
pdfView.scalesPageToFit=YES;
pdfView.autoresizingMask=(UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth);
[pdfView setDelegate:self];
NSString *path = [[NSBundle mainBundle] pathForResource:@"com" ofType:@"pdf"];
NSLog(@"Path of res is%@",path);
NSURL *url = [NSURL fileURLWithPath:path];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
[pdfView loadRequest:request];
}
Run Code Online (Sandbox Code Playgroud) 我在ASIFormDataRequest中苦苦挣扎.
我想在iphone上的facebook上传一张照片,以便我在编程中使用ASIFormDataRequest,但它给出了我的错误 _OBJC_CLASS_$_ASIFormDataRequest,参考:
我不明白它的含义,我该如何处理它
我上传照片的代码如下:
-(void)postphoto:(id)sender
{
UISegmentedControl* _segControl;
//ASIFormDataRequest *request;
UIImageView *_imageView = [UIImageView alloc];// initWithImage: image];
NSString *likeString;
NSString *filePath = nil;
if (_imageView.image == [UIImage imageNamed:@"angelina.jpg"]) {
filePath = [[NSBundle mainBundle] pathForResource:@"angelina" ofType:@"jpg"];
likeString = @"babe";
} else if (_imageView.image == [UIImage imageNamed:@"depp.jpg"]) {
filePath = [[NSBundle mainBundle] pathForResource:@"depp" ofType:@"jpg"];
likeString = @"dude";
} else if (_imageView.image == [UIImage imageNamed:@"maltese.jpg"]) {
filePath = [[NSBundle mainBundle] pathForResource:@"maltese" ofType:@"jpg"];
likeString = @"puppy";
}
if (filePath == nil) return; …Run Code Online (Sandbox Code Playgroud)