小编Mih*_*Oza的帖子

无法将视频保存到相机胶卷(目标C)

所以我一直试图在相当长的一段时间内完成这项工作,但不幸的是,堆栈上发布的解决方案或我试图自己编写的解决方案似乎都没有.我正在构建一个允许用户拍摄照片和视频的应用程序,以及其他用户将其保存下来.我正在使用AWS服务来保存内容.虽然返回的URL使用NSLog,但在将其复制/粘贴到浏览器时向我显示视频,它拒绝保存到相机胶卷.保存图片但工作正常.

到目前为止我尝试了以下内容:

    -(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
        if([mediaType isEqualToString:(NSString *)kUTTypeMovie]) {
           NSURL *movieUrl = [info objectForKey:UIImagePickerControllerMediaURL];
           ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
           [library writeVideoAtPathToSavedPhotosAlbum:movieUrl completionBlock:^(NSURL *assetURL, NSError *error){
           if(error) {
            NSLog(@"CameraViewController: Error on saving movie : %@ {imagePickerController}", error);
         } else {
            NSLog(@"URL: %@", assetURL);
        }
     }];
  }
}  
Run Code Online (Sandbox Code Playgroud)

并且:

    if (UIVideoAtPathIsCompatibleWithSavedPhotosAlbum(self.post.mediaUrl)) {
            UISaveVideoAtPathToSavedPhotosAlbum(self.post.mediaUrl, self, @selector(video:finishedSavingWithError:contextInfo:),@selector(video:finishedSavingWithError:contextInfo:));
    } else {
        NSLog(@"Incompatible File apparently");
    }
Run Code Online (Sandbox Code Playgroud)

有什么建议?谢谢!

mp4 amazon-web-services ios

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

UIImageView无法以编程方式更改位置

我正在开发iPhone应用程序,我需要重新定位UIImageView.到目前为止,这是我到目前为止所做的:

import UIKit
import CoreGraphics
import AVFoundation
import QuartzCore

class _DBubbleViewController: UIViewController {
    @IBOutlet weak var BubbleBackground: UIImageView!
    @IBOutlet weak var Bubble: UIImageView!


override func viewWillAppear(animated: Bool) {
Bubble.frame = CGRect(x: 168, y: 220, width: Bubble.bounds.size.width,      height: Bubble.bounds.size.height)
Run Code Online (Sandbox Code Playgroud)

我检查@IBAction已正确连接,但是当我运行程序时,UIImageView位置没有改变.有人可以帮忙吗?

uiimageview ios swift

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

Swift Bundle ID错误中的GCM

我在Swift中执行Google Cloud Messaging时遇到了麻烦.使用GCMExample目标CI我正在获取注册令牌,但是当我尝试运行GCMExampleSwift哪个是Swift时,我收到错误.我对Objective C和Swift都使用相同的'GoogleService-Info.plist'.

2015-10-26 17:31:59.834 GcmExampleSwift [360:51727]配置文件'GoogleService-Info.plist'用于另一个包标识符('com.XXXXXX.mobility.appfactory.dev1.social').使用此文件可能无法正确配置服务.要继续使用此配置文件,您可以将应用程序的包标识符更改为"com.XXXXXX.mobility.appfactory.dev1.social".或者您可以从https:/ 2015-10-26 17:31:59.836 GcmExampleSwift [360:]应用测量v.1100000下载与您的软件包标识符匹配的新配置文件2015-10-26 17:31:59.843 GcmExampleSwift [ 360:51727]已成功配置[CloudMessaging].2015-10-26 17:31:59.843 GcmExampleSwift [360:51727]无法配置[].2015-10-26 17:31:59.843 GcmExampleSwift [360:51727]子目标不存在,因此未配置[Analytics,AdMob,SignIn,AppInvite,Maps].2015-10-26 17:31:59.843 GcmExampleSwift [360:51727]预期存在的子规格[CloudMessaging,Measurement].2015-10-26 17:31:59.936 GcmExampleSwift [360:]网络状态已更改.code,status:2,Connected 2015-10-26 17:31:59.977:GGLInstanceID | 无法在缓存中找到令牌错误域= com.google.iid代码= -25300"(null)"注册到GCM失败并显示错误:无法完成操作.(com.google.HTTPStatus错误401.)2015-10-26 17:32:01.053 GcmExampleSwift [360:51727] - 在仅变换图层中更改属性masksToBounds将无效2015-10-26 17:32:01.053 GcmExampleSwift [360:51727] - 在仅变换图层中更改属性masksToBounds,将无效2015-10-26 17:32:01.053 GcmExampleSwift [360:51727] - 在仅变换图层中更改属性masksToBounds,将无效

ios google-cloud-messaging bundle-identifier swift

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

不推荐使用'MPMoviePlayerController':首先在iOS 9.0中弃用

已经有人在swift中回答这个问题
MPMoviePlayerController'在swift中被弃用了我想在Objective-C中使用它.

我收到了这个警告

不推荐使用'MPMoviePlayerController':首先在iOS 9.0中弃用

这是我的代码:

MPMoviePlayerController* _moviePlayer;
_moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:contentURL];
_moviePlayer.shouldAutoplay = YES;
[self.view addSubview:_moviePlayer.view];
[_moviePlayer setFullscreen:YES animated:YES];
Run Code Online (Sandbox Code Playgroud)

objective-c deprecated mpmovieplayercontroller ios ios9

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