你好,这是我在CATiledlayer中绘制pdf的代码
- (void)drawLayer:(CALayer *)layer inContext:(CGContextRef)ctx
{
CGContextSetRGBFillColor(ctx, 1.0, 1.0, 1.0, 1.0);
CGContextFillRect(ctx, CGContextGetClipBoundingBox(ctx));
CGContextTranslateCTM(ctx, 0.0, layer.bounds.size.height);
CGContextScaleCTM(ctx, 1.0, -1.0);
CGContextConcatCTM(ctx, CGPDFPageGetDrawingTransform(myPageRef, kCGPDFCropBox, layer.bounds, 0, true));
CGContextDrawPDFPage(ctx, myPageRef);
}
Run Code Online (Sandbox Code Playgroud)
一切都很好但我在下面的行中得到了内存泄漏警告
CGContextDrawPDFPage(ctx, myPageRef);
Run Code Online (Sandbox Code Playgroud)
这里的myPageRef是CGPDFPageRef
我需要一个条形码引擎来支持iPhone的3种以上条形码类型(1D,QR码,数据矩阵).我试过zxing,zbar在我的情况下不支持数据矩阵.我也发现了一些商业版本.
但我正在寻找一个免费的SDK.
我正在使用HJCachelib来缓存我的iPhone应用程序中的图像.
我收到以下错误,但不是所有图像,只是第一个(不)出现.
HJMOFileCache 无法将加载文件移动到就绪文件 /Users/joao__garcia/.../Library/Caches/imgcache/ready/http:__uni.....jpg
加载以下图像没有问题.有人知道发生了什么事吗?
我这样得到目录:
objMan = [[HJObjManager alloc] init];
NSString* cacheDirectory = [NSHomeDirectory() stringByAppendingString:@"/Library/Caches/imgcache"] ;
HJMOFileCache* fileCache = [[HJMOFileCache alloc] initWithRootPath:cacheDirectory];
objMan.fileCache = fileCache;
Run Code Online (Sandbox Code Playgroud)
然后:
managedImage = [[HJManagedImageV alloc] initWithFrame:CGRectMake(96, 88, 185, 167)];
managedImage.url = [NSURL URLWithString:[NSString stringWithFormat:@"http:...",video.thumb_video]];
NSLog(@"%@", managedImage.url);
[objMan manage:managedImage];
// [objMan performSelectorOnMainThread:@selector(manage:) withObject:managedImage waitUntilDone:YES];
NSLog(@"image %@", managedImage.image);
[managedImage sizeToFit];
playVideoViewButton.backgroundColor = [UIColor colorWithPatternImage:managedImage.image];
Run Code Online (Sandbox Code Playgroud) 我使用下面的代码绘制了这么多弧:
CGContextAddArc(context,
e.x,
e.y,
Distance/2,
M_PI+angle1,
angle1,
aClock);
CGContextStrokePath(context)
Run Code Online (Sandbox Code Playgroud)
现在我希望当我触摸任何拱形时,我想要检测到哪个弧被触摸过
我怎样才能做到这一点?
我已经搜索了很多这个问题,但似乎没有答案.所以我希望你们中的一些人知道如何解决这个问题.我有一个具有tableview的视图控制器,当我用动画更改视图框架时,一切顺利,除了一个特殊情况,当tableview有更多的项目而不是它适合屏幕时,并且只有当tableview滚动到底部时.然后,如果我缩小视图高度,我的视图正确动画,但tableview以某种方式跳起来,然后动画到底部.
如果我收缩视图,但tableview没有滚动到底部(即使我可以看到最后一个单元格,让我们说它超过一半)它会正确地进行动画制作.
我已经尝试了几件事,比如开启和关闭自动调整遮罩,以及从当前状态或类似的东西设置动画,但这没有帮助:/
那么任何建议可能是什么问题?
编辑:
我用来改变框架的代码
[UIView animateWithDuration:0.5
delay:0.0
options: UIViewAnimationCurveEaseOut
animations:^{
[_contView setFrame:CGRectMake(0, 0, 320, 420)];
}
completion:^(BOOL finished){
}];
Run Code Online (Sandbox Code Playgroud) 在iOS 6中使用MapKit,我应该如何在没有特定坐标的情况下到达附近的位置?我也不确定它是否仍有可能......错误...... 允许 ......使用Google Maps API来实现这一目标,因为这是我能想到的唯一方法.
我知道所有内容仍处于测试阶段,但我仍然没有在任何地方找到有关此主题的信息,无论是在论坛上,在Apple的新MapKit文档中.我想要做的就是在用户位置的'x'英里内搜索位置(例如,公园).
看来,既然Apple开发了自己的Maps应用程序,他们应该有办法使用MapKit或Core Location来实现这一点......对吗?
我们可以在UITableView中创建树结构,如下所示.
-Sub1 //First row
-Sub1sub1 //First row's child
-sub1sub1sub1 //Child's child etc..
-sub1sub1sub2
-Sun1sub2
-sub2sub2sub1
-sub2sub2sub2
-Sub2
-Sub2sub1
-sub1sub2sub1
-sub1sub1sub2
-Sun2sub2
-sub2sub2sub1
-sub2sub2sub2
Run Code Online (Sandbox Code Playgroud)
不想要任何代码,但有任何参考实现这个..或只是让我知道它是否可能..
请帮我解决这个问题..
提前致谢.
有没有办法在iPhone应用程序PhotoTwist中使用OpenGL ES在UIImage上创建像凹痕,捏,扭曲,挤压等效果?
这样做是否有任何参考或指导?我不想要代码,只是如何做到这一点的参考.
是否有任何参考教程可以在小型或中型环境中获取图像大小.
我只是想知道根据宽度和高度计算图像大小,我们如何计算UIImage大小,当像小苹果邮件一样小,中等或大时.
这就像我们在Mail中附加图像时要求小,中,大..
Plz不提供这个,因为我已经经历了这个..
提前致谢.
我有iPhone,我希望在AlertView显示时,用户按下OK按钮后应该更改该视图但不会发生.
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Thank you" message:@"" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
return;
[self moveToView];
-(void)moveToView
{
MainViewController*targetController=[[MainViewController alloc]init];
[self.navigationController pushViewController:targetController animated:YES];
}
Run Code Online (Sandbox Code Playgroud) iphone ×9
ios ×5
objective-c ×5
ipad ×3
uitableview ×2
barcode ×1
caching ×1
cgcontext ×1
cocoa-touch ×1
ios4 ×1
ios6 ×1
mapkit ×1
opengl-es ×1
uiimage ×1
xcode ×1