当我的应用程序在后台时,我想知道是否可以发送一些webservice调用.skype是如何做到的?即使我按下主页按钮,我的通话也保持连接状态.
嗨,所以我试图解析一些pdf中的一些文本,我想使用PoDoFo,现在我已经尝试搜索如何使用PoDoFo解析pdf的例子,但我能想到的只是如何创建的示例并写一个不是我真正需要的pdf文件.
如果有人有任何使用PoDoFo解析PDF文件的教程或示例,或者有我可以使用的其他库的建议,请告诉我.另外我知道linux上有pdftotext,但是,我不仅可以不使用它,而且我更愿意在内部完成所需的一切,而不是依赖于正在安装的外部程序.
有时AVPlayer失败,AVPlayerItemStatusFailed
并且在失败发生后,AVPlayer继续失败AVPlayerItemStatusFailed
.我试图清除AVPlayer实例并创建新实例,但我无法实现AVPlayerItemStatusFailed
无法解决.也removingFromSuperview
UIView
有AVPlayer实例和初始化新项目与AVPlayer不会解决问题.
所以我认为AVPlayer无法完全清除.是否有人建议完全清除AVPlayer并使其在失败后工作?
错误日志:
Error Domain=AVFoundationErrorDomain Code=-11800 "The operation could not be completed" UserInfo=0x1a689360 {NSLocalizedDescription=The operation could not be completed, NSUnderlyingError=0x1a688e70 "The operation couldn’t be completed. (OSStatus error -12983.)", NSLocalizedFailureReason=An unknown error occurred (-12983)}
Run Code Online (Sandbox Code Playgroud)
UPD. 对于@matt
playerItem = [AVPlayerItem playerItemWithURL:[NSURL fileURLWithPath:filePath.path]];
if (!self.avPlayer) {
avPlayer = [AVPlayer playerWithPlayerItem:playerItem];
}
[avPlayer.currentItem addObserver:self forKeyPath:@"status" options:0 context:nil];
if (self.avPlayer.currentItem != self.playerItem) {
[self.avPlayer replaceCurrentItemWithPlayerItem:playerItem];
}
AVPlayerLayer *avPlayerLayer = [AVPlayerLayer playerLayerWithPlayer:avPlayer];
avPlayerLayer.frame = self.bounds;
[self.layer addSublayer:avPlayerLayer]; …
Run Code Online (Sandbox Code Playgroud) 我正在从我的本地数据库实现一个搜索栏,当用户输入信息时从db中搜索.问题是我将最近的字符和之前的字符连接起来然后发送给它进行搜索.如何在返回时删除字符(最后一个)按键是我正在使用的
- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
谢谢你的回复
我刚刚升级到xcode 4.6,调试器发生了奇怪的事情."po"命令有时会停止工作.一步一步调试有时也行不通.是否有其他人有同样的问题
我有一个来自服务器的PDF文档,我希望它在iPad上的UIPageViewController上显示它,以便给它一个很好的页面卷曲效果.我能想到的唯一方法是将PDF分成页面然后使用每个页面都是一个单独的视图控制器.任何人都知道我怎么能这样做?.你推荐什么,将pdf分成一组pdf或pngs.I我不怕CGPdfPageRef所以我可能不会使用UIWebview.谢谢
我正在重写一些代码以消除全局变量并使类构造函数/析构函数句柄清理某些第三方库资源,但我担心一些代码会从类初始化列表中的另一个成员初始化一个成员.
class MyPodofoDocument {
public:
// generates pdf to stream
MyPodofoDocument(std::stringstream *pStringStream)
: device(pStringStream), document(&device)
{
}
private:
PoDoFo::PdfOutputDevice device;
PoDoFo::PdfStreamedDocument document;
PoDoFo::PdfPainter painter;
};
Run Code Online (Sandbox Code Playgroud)
使用这个类的代码不需要查看使用该库的所有细节,但是我隐藏它们的方式使它依赖于使用成员初始化其他成员,然后才能访问构造函数的实际代码块,在那里它有一个有效的this指针.
它适用于单元测试骨架,所以我的问题基本上是,"这样可以,便携且安全吗?"
我想在iOS应用程序中注释PDF.我遇到了PoDoFo库,但我不确定如何在iOS应用程序中使用它.
是否可以使用此库在iOS上注释PDF?如果是这样,怎么样?
我正在尝试使用具有注释(如小部件和链接)的代码生成PDF。我可以生成PDF并修改文档信息和页面的MediaBox,但是我不知道如何添加到注释中。我尝试将其添加到页面字典中,但是由于某种原因,PDF不接受它。
有人知道如何将注释添加到新创建的PDF吗?以下是我要生成的PDF和要添加的测试注释词典的代码:
-(void) createPDFFile: (CGPDFPageRef) pageRef{
CGContextRef pdfContext;
CFStringRef path;
CFURLRef url;
CFMutableDictionaryRef myDictionary = NULL;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0]; // Get documents folder
const char *filepath = [[documentsDirectory stringByAppendingString:@"/fileTest.pdf"] UTF8String];
path = CFStringCreateWithCString (NULL, filepath, kCFStringEncodingUTF8);
url = CFURLCreateWithFileSystemPath (NULL, path, kCFURLPOSIXPathStyle, 0);
CFRelease (path);
myDictionary = CFDictionaryCreateMutable(NULL, 0,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);
CFDictionarySetValue(myDictionary, kCGPDFContextTitle, CFSTR("My PDF File"));
CFDictionarySetValue(myDictionary, kCGPDFContextCreator, CFSTR("My Name"));
CGRect pageRect = self.bounds;
pdfContext = CGPDFContextCreateWithURL (url, &pageRect, myDictionary); // 5 …
Run Code Online (Sandbox Code Playgroud) ios ×5
iphone ×4
podofo ×4
c++ ×2
ipad ×2
pdf ×2
annotations ×1
avfoundation ×1
avplayer ×1
avplayeritem ×1
debugging ×1
geolocation ×1
lldb ×1
objective-c ×1
parsing ×1
uitextfield ×1
web-services ×1
xcode ×1
xcode4.6 ×1