小编Sud*_*ari的帖子

在Instagram上发布视频

我正在开发应用程序,我需要在Instagram上发布图像/视频.我已经成功地使用以下代码在Instagram上发布图像:

        NSString* filename = [NSString stringWithFormat:@"myimage.igo"];
        NSString* savePath = [imagesPath stringByAppendingPathComponent:filename];
        [UIImagePNGRepresentation(myImage) writeToFile:savePath atomically:YES];
        NSURL *instagramURL = [NSURL URLWithString:@"instagram://app"];
        if ([[UIApplication sharedApplication] canOpenURL:instagramURL])
        {
            self.documentInteractionController = [UIDocumentInteractionController interactionControllerWithURL:[NSURL fileURLWithPath:savePath]];
            self.documentInteractionController.UTI = @"com.instagram.image";
            self.documentInteractionController.delegate = self;
            [self.documentInteractionController presentOpenInMenuFromRect:CGRectZero inView:self.view animated:YES];
        }
Run Code Online (Sandbox Code Playgroud)

但没有找到任何方式发布视频.我检查了Instagram应用程序,发现我们也可以发布/上传视频.它意味着通过代码它应该是可能的.有人知道吗?

提前致谢.

objective-c ios instagram

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

键盘没有响应

我想知道这个错误.为什么会这样.当我输入一些文字时,我的键盘没有响应.它给出了这个错误:

-[UIKeyboardInputManagerClient handleError:forRequest:] will retry sending 
 generateCandidatesWithKeyboardState:candidateRange:continuation: to keyboard daemon after 
 receiving Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. 
 (Cocoa error 4097.)
Run Code Online (Sandbox Code Playgroud)

我必须等待一段时间,以便我可以再次输入文本.请建议我如何删除此错误.

非常感谢.

xcode uikeyboard ios7

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

Facebook使用开放图表像发帖请求一样卷曲

我想iOS通过使用在我的应用程序中创建类似的按钮

curl -X POST \
  -F 'access_token=USER_ACCESS_TOKEN' \
  -F 'object=OG_OBJECT_URL' \
  https://graph.facebook.com/[User FB ID]/og
Run Code Online (Sandbox Code Playgroud)

由...给出的Open graph api.

为此,我发了邮件请求即

  NSString *stringurl=[NSString stringWithFormat:@"{access_token=AAAE08AxGmwghghghOWAxMZBz6jZAaRTUYTRMakJln3VdAeUju6E6tFn2I9feY5wtGatTm2KIgXoXYFZB0pTPQt2Oj0sNaRuX3AZDZD}&{object=http://www.google.com}&https://graph.facebook.com/100002097766610/og.likes"];

NSURL *url = [NSURL URLWithString: stringurl];
NSMutableURLRequest *request1 = [NSMutableURLRequest requestWithURL:url];

[request1 setURL:url];
[request1 setHTTPMethod:@"POST"];
[request1 setValue:@"application/json" forHTTPHeaderField:@"Content-Type"];

NSError *error;
NSURLResponse *response;
NSData *data = [NSURLConnection sendSynchronousRequest:request1 returningResponse:&response error:&error];
NSString *string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
NSLog(@"string..:%@",string);
Run Code Online (Sandbox Code Playgroud)

但我得到空字符串.可能是我正在制作错误的url字符串.如果有人知道如何发出curl post请求.请给我一些想法.

谢谢大家.

iphone curl objective-c facebook-graph-api ios

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

从开发人员帐户中删除所有配置文件和证书

我想知道如果从开发者帐户中删除所有配置文件和证书,那么会发生什么?应用程序是否会受到影响?

请帮助我理解这个主题.

iphone ssl-certificate ios provisioning-profile ios-provisioning

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

制作视频时显示录制计时器

我已经实现了AVCaptureSession的概念来录制视频.

-(void)startRecordingWithOrientation:(AVCaptureVideoOrientation)videoOrientation 
{

    AVCaptureConnection *videoConnection = [AVCamUtilities   
                                           connectionWithMediaType:AVMediaTypeVideo  
                                           fromConnections:[[self movieFileOutput] connections]];
    if ([videoConnection isVideoOrientationSupported])
        [videoConnection setVideoOrientation:videoOrientation];

    [[self movieFileOutput] startRecordingToOutputFileURL:[self outputFileURL]  
    recordingDelegate:self];
 } 
Run Code Online (Sandbox Code Playgroud)

它正确录制视频,但屏幕上没有录制计时器.任何人都知道如何在制作视频时显示计时器.

提前致谢.

objective-c ios avcapturedevice avcam

5
推荐指数
3
解决办法
3684
查看次数

XMPPFramework - 上传个人资料或头像图片

我正在使用我使用xmpp框架的聊天应用程序.我可以通过xmpp发送或接收消息.但是,当我尝试使用以下代码上传用户个人资料或头像图像时,没有获得成功.

NSData *data = [NSData dataWithContentsOfURL:[NSURL URLWithString:stringPath]];
UIImage *tmpImage = [[UIImage alloc] initWithData:data];
UIImageView *thumbimage;
thumbimage.image = tmpImage;

NSData *imageData1 = UIImageJPEGRepresentation(thumbimage.image,0.5);
NSXMLElement *vCardXML = [NSXMLElement elementWithName:@"vCard" xmlns:@"vcard-temp"];
NSXMLElement *photoXML = [NSXMLElement elementWithName:@"PHOTO"];
NSXMLElement *typeXML = [NSXMLElement elementWithName:@"TYPE" stringValue:@"image/jpeg"];
NSXMLElement *binvalXML = [NSXMLElement elementWithName:@"BINVAL" stringValue:[[NSString alloc] initWithData:imageData1 encoding:NSUTF8StringEncoding]];

[photoXML addChild:typeXML];
[photoXML addChild:binvalXML];
[vCardXML addChild:photoXML];

XMPPvCardTemp *myvCardTemp = [[[self appDelegate] xmppvCardTempModule] myvCardTemp];

if (myvCardTemp) {
    [myvCardTemp setPhoto:imageData1];
    [[[self appDelegate] xmppvCardTempModule] updateMyvCardTemp:myvCardTemp];
}
Run Code Online (Sandbox Code Playgroud)

请帮我实现上传图像概念到XMPP或纠正我如果我在代码中做错了什么.

提前致谢.

xmpp objective-c ios xmppframework

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

重新调整api身份验证错误

我正在实现iOS应用程序,我必须实现Respoke SDK进行音频和视频通话.音频和视频功能在开发模式下工作正常,但在生产模式下,它给出了错误"Api身份验证错误".我已将此代码用于生产:

        [self.client connectWithTokenID:[[aryResult valueForKey:@"data"]valueForKey:@"token"] initialPresence:nil errorHandler:^(NSString *errorMessage)
         {
             [self showError:errorMessage];
         }];
Run Code Online (Sandbox Code Playgroud)

作为参考,我使用过:Respoke Documentation

请告诉我最后缺少什么.请帮帮我.

非常感谢提前!

audio video objective-c ios

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

UINavigationBar 隐藏在 statusBar 下

在某些UIViewControllerUINavigationBar隐藏在状态栏下。这是屏幕截图:

状态栏下的 <code>UINavigationBar</code>

但是当我更改View controller-based status bar appearanceYESthen 时UINavigationBar看起来很完美。这是屏幕截图:

<code>UIStatusBar</code> 中的黑色文本

但在这种情况下,textColorofstatus bar会从白色变为黑色。我想要状态栏的白色文本颜色,并UINavigationBar从状态栏中取消隐藏。有没有办法解决它(状态栏的白色和取消隐藏UINavigationBar)。

提前致谢!

objective-c uinavigationbar ios uistatusbar

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

类型'Int32'不符合协议'AnyObject'Swift?

我有一个Model,子类NSObject,如下所示.

class ConfigDao: NSObject {
    var categoriesVer : Int32 = Int32()
    var fireBallIP : String =  String ()
    var fireBallPort : Int32 = Int32()
    var isAppManagerAvailable : Bool = Bool()
    var timePerQuestion : String = String ()
    var isFireballAvailable : Bool = Bool ()
}
Run Code Online (Sandbox Code Playgroud)

我已经下载NSMutableData并使用JSON它制作NSJSONSerialization.

我的代码是

func parserConfigData (data :NSMutableData) -> ConfigDao{

        var error : NSError?
        var json = NSJSONSerialization.JSONObjectWithData(data, options: NSJSONReadingOptions.MutableContainers, error: &error) as NSDictionary

        var configDao : ConfigDao = …
Run Code Online (Sandbox Code Playgroud)

iphone int32 ios swift

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

WKWebView 在 iOS 16.1 中没有响应。实时应用程序未加载应用程序中的内容

我已将我的设备更新至 iOS 16.1。现在我的实时应用程序没有响应 webview。我已经使用 WKWebView 并尝试加载 URL。它根本没有响应。

这是代码:

let link = URL(string:"company URL")!
let myRequest = URLRequest(url: link)
webView.load(myRequest)
Run Code Online (Sandbox Code Playgroud)

这是我遇到的问题

[pageProxyID=6, webPageID=7, PID=18450] WebPageProxy::tryReloadAfterProcessTermination: process crashed and the client did not handle it, not reloading the page because we reached the maximum number of attempts


Error acquiring assertion: <Error Domain=RBSServiceErrorDomain Code=1 "target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit" UserInfo={NSLocalizedFailureReason=target is not running or doesn't have entitlement com.apple.runningboard.assertions.webkit}>
Run Code Online (Sandbox Code Playgroud)

它根本没有加载。

xcode ios swift wkwebview

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