小编Rit*_*ika的帖子

MPMoviePlayerController显示黑色空屏幕

我用MPMoviePlayerController我在我的Application Document文件夹中播放一个本地文件,我已经下载了服务器URL:

itemMoviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];
 [self.view addSubview:itemMoviePlayerController.view];
 itemMoviePlayerController.fullscreen = YES;
 itemMoviePlayerController.movieSourceType = MPMovieSourceTypeFile;
 itemMoviePlayerController.initialPlaybackTime = -1.0;
 [itemMoviePlayerController play];
Run Code Online (Sandbox Code Playgroud)

当我.mov下载文件后播放文件时,它显示一个黑色的空白屏幕,应用程序UI无法使用.但是如果下次播放相同的本地文件,它可以正常播放.我甚至验证playStatelocalStateMPMoviePlayerController他们似乎罚款.什么可能是黑色空屏幕的原因?

video objective-c mpmovieplayercontroller ios

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

iframe的安全性错误

Android 4.4及更高版本设备中出现以下问题.

这就是我们的iframe看起来像:

<iframe frameborder=0 id="myIFRAME"></iframe>
Run Code Online (Sandbox Code Playgroud)

以下是我们以编程方式获取iframe的方式:

if(document.getElementById("myIFRAME")){
        me.setMyIFRAME(document.getElementById("myIFRAME").contentWindow);
}
Run Code Online (Sandbox Code Playgroud)

这导致与协议不匹配相关的安全性错误:

"Uncaught SecurityError:阻止带有原点" https://www.google.com "的框架访问带有"file://"的框架.请求访问的框架具有"https"协议,正在访问的框架具有协议"文件".协议必须匹配.

我们正在使用Sencha touch与Cordova开发我们的项目.

javascript iframe android sencha-touch cordova

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

iOS QLPreviewController从远程服务器URL加载文件

从QLPreviewController上的远程服务器加载文件时应使用什么方法?我们何时应该使用服务器API下载文件以将其加载到QLPreviewController上。我将QLPreviewController作为子视图添加到当前视图。我可以使用数据源方法来调用从服务器下载文件。

- (id<QLPreviewItem>)previewController:(QLPreviewController *)controller previewItemAtIndex:(NSInteger)index
Run Code Online (Sandbox Code Playgroud)

但是,一旦文件下载完毕,我需要重新加载QLPreviewController,该操作应在此处完成。对于图像,我想查看图库视图,以便滑动查看从服务器下载的图像。谁能指出我的任何教程来从远程服务器URL加载图像

download image-gallery nsurlconnection ios qlpreviewcontroller

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

启动时找不到符号的iOS 5.1应用程序崩溃:_NSFontAttributeName

我在使用iOS 5.1.1在iPad上运行app时遇到错误

dyld: Symbol not found: _NSFontAttributeName
  Referenced from: /var/mobile/Applications/9471D711-BCA7-4529-A584-9747C2E03DBC/egnyteMobileIOSUniversal.app/egnyteMobileIOSUniversal
  Expected in: /System/Library/Frameworks/UIKit.framework/UIKit
 in /var/mobile/Applications/9471D711-BCA7-4529-A584-9747C2E03DBC/egnyteMobileIOSUniversal.app/egnyteMobileIOSUniversal
Run Code Online (Sandbox Code Playgroud)

在我的代码中,我现在使用NSFontAttributeName常量.我知道它支持iOS等于或高于6.0.在我的代码中我都使用NSAttributedString类.
这可能是其他方法或UI控件在内部调用此方法吗?
堆栈跟踪不会给我任何有关哪个代码或方法遇到此问题的信息.
有没有办法可以正确调试跟踪符号错误?我的应用程序支持min 5.0 iOS

crash debugging nsattributedstring ios ios5

4
推荐指数
1
解决办法
1405
查看次数

后台任务即将到期时的本地通知

iOS应用程序可以在后台任务即将到期时安排本地通知吗?当应用程序使用NSOperationQueue进入后台时,基本上我有一些服务器端正在进行下载.
我想要的是当后台任务即将完成时通过本地通知通知用户.那么该用户可以将应用程序带到前台以保持持续的服务器数据下载
以下是我正在使用的代码,但我没有看到任何本地通知

UIBackgroundTaskIdentifier bgTask = [application beginBackgroundTaskWithExpirationHandler: ^{
        dispatch_async(dispatch_get_main_queue(), ^{
           /*TO DO
            prompt the user if they want to continue syncing through push notifications. This will get the user to essentially wake the app so that sync can continue.
             */
            // create the notification and then set it's parameters
            UILocalNotification *beginNotification = [[[UILocalNotification alloc] init] autorelease];
            if (beginNotification) {
                beginNotification.fireDate = [NSDate date];
                beginNotification.timeZone = [NSTimeZone defaultTimeZone];
                beginNotification.repeatInterval = 0;
                beginNotification.alertBody = @"App is about to exit .Please bring …
Run Code Online (Sandbox Code Playgroud)

background ios uilocalnotification

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