小编Qam*_*man的帖子

iOS应用程序在后台执行任务

当我的应用程序在后台时,我想知道是否可以发送一些webservice调用.skype是如何做到的?即使我按下主页按钮,我的通话也保持连接状态.

web-services objective-c background-process ios

25
推荐指数
2
解决办法
6万
查看次数

用C++解析PDF(PoDoFo)

嗨,所以我试图解析一些pdf中的一些文本,我想使用PoDoFo,现在我已经尝试搜索如何使用PoDoFo解析pdf的例子,但我能想到的只是如何创建的示例并写一个不是我真正需要的pdf文件.

如果有人有任何使用PoDoFo解析PDF文件的教程或示例,或者有我可以使用的其他库的建议,请告诉我.另外我知道linux上有pdftotext,但是,我不仅可以不使用它,而且我更愿意在内部完成所需的一切,而不是依赖于正在安装的外部程序.

c++ pdf parsing podofo

11
推荐指数
1
解决办法
2万
查看次数

AVPlayer因AVPlayerItemStatusFailed失败(OSStatus错误-12983)

有时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)

avfoundation ios avplayer avplayerlayer avplayeritem

10
推荐指数
1
解决办法
8206
查看次数

UITextField如何检查是否按下了删除键

我正在从我的本地数据库实现一个搜索栏,当用户输入信息时从db中搜索.问题是我将最近的字符和之前的字符连接起来然后发送给它进行搜索.如何在返回时删除字符(最后一个)按键是我正在使用的

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string

谢谢你的回复

iphone uitextfield ios

7
推荐指数
2
解决办法
9189
查看次数

Xcode 4.6 Debugger的奇怪问题."po"命令不起作用

我刚刚升级到xcode 4.6,调试器发生了奇怪的事情."po"命令有时会停止工作.一步一步调试有时也行不通.是否有其他人有同样的问题

debugging xcode lldb xcode4.6

7
推荐指数
1
解决办法
1730
查看次数

iOS从Zipcode查找位置(纬度,经度)

什么是获取给定邮政编码的最佳位置.它适用于美国/加拿大以外的国家.谢谢

iphone geolocation

6
推荐指数
1
解决办法
4779
查看次数

将Pdf分割成页面以便在UIPageViewController上显示

我有一个来自服务器的PDF文档,我希望它在iPad上的UIPageViewController上显示它,以便给它一个很好的页面卷曲效果.我能想到的唯一方法是将PDF分成页面然后使用每个页面都是一个单独的视图控制器.任何人都知道我怎么能这样做?.你推荐什么,将pdf分成一组pdf或pngs.I我不怕CGPdfPageRef所以我可能不会使用UIWebview.谢谢

iphone ipad uipageviewcontroller

6
推荐指数
2
解决办法
3151
查看次数

我可以使用在初始化列表中初始化的C++类成员,稍后在列表中吗?

我正在重写一些代码以消除全局变量并使类构造函数/析构函数句柄清理某些第三方库资源,但我担心一些代码会从类初始化列表中的另一个成员初始化一个成员.

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指针.

它适用于单元测试骨架,所以我的问题基本上是,"这样可以,便携且安全吗?"

c++ instantiation class-constructors podofo

6
推荐指数
1
解决办法
651
查看次数

如何使用PoDoFo库在iOS上注释PDF?

我想在iOS应用程序中注释PDF.我遇到了PoDoFo库,但我不确定如何在iOS应用程序中使用它.

是否可以使用此库在iOS上注释PDF?如果是这样,怎么样?

pdf iphone ipad ios podofo

5
推荐指数
1
解决办法
1562
查看次数

如何使用Annots创建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)

pdf-generation annotations core-graphics ios podofo

5
推荐指数
1
解决办法
1813
查看次数