小编Mar*_*eld的帖子

找不到PDF标题:找不到`%PDF'

当我尝试加载pdf并且不知道原因时,我得到了这个日志.

failed to find PDF header: `%PDF' not found.
Run Code Online (Sandbox Code Playgroud)

她的代码:

- (void)viewDidLoad
{


    [webview loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://webdesign-schoenefeld.de/es-app/heute.pdf"]]];
    NSLog(@"---------------pdfloading....,------------------------");
    [webview addSubview:activityind];
    timer = [NSTimer scheduledTimerWithTimeInterval:(1.0/2.0)
                                             target:self
                                           selector:@selector(loading)
                                           userInfo:nil
                                            repeats:YES];
    [super viewDidLoad];
    // Do any additional setup after loading the view, typically from a nib.

}
Run Code Online (Sandbox Code Playgroud)

我使用Xcode 6 Beta 5和iOS 8 beta 5.

谢谢你的帮助.

pdf xcode objective-c ios xcode6

13
推荐指数
3
解决办法
1万
查看次数

扩展无法在运行时访问泛型参数

我正在使用AWS Cognito,在文档中我说我必须添加此功能.

但是我收到了这个错误:

泛型Objective-C类的扩展无法在运行时访问类的泛型参数

extension AWSTask {
    public func continueWithExceptionCheckingBlock(completionBlock:@escaping (_ result: Any?, _ error: Error?) -> Void) {
        self.continue({(task: AWSTask) -> Any? in
            if let exception = task.exception {
                print("Fatal exception: \(exception)")
                kill(getpid(), SIGKILL);
            }
            let result: AnyObject? = task.result
            let error: NSError? = task.error as NSError?
            completionBlock(result, error)
            return nil
        })

    }
}
Run Code Online (Sandbox Code Playgroud)

objective-c amazon-web-services swift amazon-cognito swift3

7
推荐指数
3
解决办法
2932
查看次数

由于信号命令失败:分段错误:存档时为11

我试图归档我的应用程序并得到此错误:由于信号命令失败:分段错误:11

当我构建它时,一切都很顺利,也在真实设备上.归档时会发生这种情况.任何想法如何解决?

这是错误的一部分:

0  swift                    0x000000010f79f3ad PrintStackTraceSignalHandler(void*) + 45
1  swift                    0x000000010f79eb56 SignalHandler(int) + 790
2  libsystem_platform.dylib 0x00007fffc82d5bba _sigtramp + 26
3  libsystem_platform.dylib 0x0000000000000040 _sigtramp + 936551584
4  swift                    0x000000010cae0de3 swift::CastOptimizer::optimizeUnconditionalCheckedCastAddrInst(swift::UnconditionalCheckedCastAddrInst*) + 1699
5  swift                    0x000000010cb69d4d processFunction(swift::SILFunction&, bool, unsigned int) + 1917
6  swift                    0x000000010cb70c9f (anonymous namespace)::ConstantPropagation::run() + 47
7  swift                    0x000000010caff89e swift::SILPassManager::runOneIteration() + 5166
8  swift                    0x000000010cb051f6 swift::runSILOptimizationPasses(swift::SILModule&) + 3462
9  swift                    0x000000010c7ac0e2 performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*) + 20114
10 swift                    0x000000010c7a52b3 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, …
Run Code Online (Sandbox Code Playgroud)

xcode ios swift3 xcode8

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

PHP XPath 检查是否为空

我有这个 PHP 代码:

$document = new DOMDocument();
$document->loadHTML( $html );

$xpath = new DomXPath($document);

$tables = $xpath->query("//*[contains(@class, 'info')]");
$tableDom = new DomDocument();  
$tableDom->appendChild($tableDom->importNode($tables->item(0), true));
Run Code Online (Sandbox Code Playgroud)

如何检查 $tables 变量是否包含我们可以在 $tableDom 中使用的内容?

我试过:

if (!empty($tables)) {
    echo("</br>not empty</br>");
} else {
    echo("empty");
}

if (!$tablese) {
    echo("empty</br>");
}
Run Code Online (Sandbox Code Playgroud)

但是它总是说它不是空的,所有的 HTML 都不包含带有类信息的表格。

php xpath dom

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