objective-c

Error Domain=AVFoundationErrorDomain Code=-11814 “Cannot Record”

坚强是说给别人听的谎言 提交于 2021-02-08 12:31:31
问题 It keeps on giving me the error: Error Domain=AVFoundationErrorDomain Code=-11814 "Cannot Record" I am not sure what the problem is? I am trying to record the sound right when the counter reaches 1 after a picture is taken. static int counter; //counter will always be zero it think unless it is assigned. if (counter == 0){ dispatch_async([self sessionQueue], ^{ // Update the orientation on the still image output video connection before capturing. [[[self stillImageOutput]

Tracking wifi and cellular bytes sent and received by each process/app in ios

前提是你 提交于 2021-02-08 12:13:24
问题 I went through this link regarding retrieve the applications currently running in iPhone and iPad . Is it possible to track wifi and cellular interfaces for each process running on iphone? 回答1: You can refer to this post to get the data counters, but it is for the wifi/cellular data overall, not only your app: iPhone Data Usage Tracking/Monitoring Edit : Code added - (NSArray *)getDataCounters { BOOL success; struct ifaddrs *addrs; const struct ifaddrs *cursor; const struct if_data

京东App Swift 混编及组件化落地

陌路散爱 提交于 2021-02-08 12:02:16
背景 自 Swift 诞生以来,逐步见证其从饱受诟病到日渐完善。在苹果的全力推动下,潜移默化地把开发支持中心从 Objective-C 转向 Swift,在业界的呼声也越演越烈。当我们相继迎来 ABI稳定、Module stability、Library evolution 等功能后,我们期盼已久的 Swift 已然到来,毅然启动了京东 App 的混编之旅。我们依然坚持稳扎稳打,前期对 Swift 技术做了诸多调研工作,具体可见 《Swift环境及编译优化调研》 。2020年7月京东 App 的首个混编版本上线苹果商店,完成了组件内和主工程的混编工作;近期,我们完成了对京东组件化管理工具(iBiuTool)的改造,混编组件化功能正式落地,这也标志着京东 Swift 混编基础支持建设完毕。但是,Just the beginning... 期待的Swift已经到来 2.1 ABI稳定 Swift 5.0,提供 ABI 稳定,解决了 Swift runtime 的版本兼容问题。这意味着通过 Swift 5.0 及以上的编译器编译出来的二进制,就可以运行在任意 Swift 5.0 及以上的 Swift runtime 上。ABI 稳定后,Swift runtime 和标准库已经植入 macOS 10.14.4、iOS 12.2、watchOS 5.2 及以上系统中。根据苹果官方数据,截止到

inputAccessoryView with custom view hide After I Dismiss keyboard

烈酒焚心 提交于 2021-02-08 11:58:23
问题 First of all , my project is so structured: -home page with a tableView to add element -floating Button: when clicked make appear keyboard with above a custom view (and inside a textView) to digit input Now, I have a problem with inputAccessoryView and dismiss keyboard: I have used inputAccessoryView to move a custom view above the keyboard like this: MytextView.inputAccessoryView= MyContainerView; And this work correctly. My problem occur when I dismiss keyboard using: [MytextView

Adding UITextView to custom tableViewCell = Crash

怎甘沉沦 提交于 2021-02-08 11:57:27
问题 I have a custom tableview cell, which contains some object UIImageView, UILabel, and a UITextView. All object, except the UITextView works fine, but when I try to change the text on the textView: myTextView.text = @"Some string"; the app crashes with this error: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now... Any suggestion is very appreciated. Thanks 回答1: The error

Why is self.navigationController NULL when pushed from UITabBarController subviews

不羁的心 提交于 2021-02-08 11:51:28
问题 This is what I am doing. I have a tabBarControllerOne with 5 tabs. On clicking one of the tabs, I present a modal view controller, which has a navigationBar and a TabBarControllerTwo (with 3 tabs). These three tabs are the matter for concern here. In the 5th Tab of tabBarController I show modalViewController as UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:self.nextTabView]; // navController.navigationBarHidden = YES; navController

semaphore doesn't work as expected in my case

吃可爱长大的小学妹 提交于 2021-02-08 11:13:14
问题 This is the scenario: I want to add an observer to monitor events & when an event is triggered & processed, I wait for the result in callback block, if result is fine, I do other task. If wait timeout, I just print error message. I use semaphore to achieve the above thing with the following simple code: -(void)waitForResultThenDoOtherTask { BOOL shouldPrintErr = NO; // I create a semaphore dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); // I have an observer with a callback,

semaphore doesn't work as expected in my case

落花浮王杯 提交于 2021-02-08 11:12:35
问题 This is the scenario: I want to add an observer to monitor events & when an event is triggered & processed, I wait for the result in callback block, if result is fine, I do other task. If wait timeout, I just print error message. I use semaphore to achieve the above thing with the following simple code: -(void)waitForResultThenDoOtherTask { BOOL shouldPrintErr = NO; // I create a semaphore dispatch_semaphore_t semaphore = dispatch_semaphore_create(0); // I have an observer with a callback,

UIView.layer.presentationLayer returns final value (rather than current value)

我们两清 提交于 2021-02-08 10:53:24
问题 Here's some relevant code inside a UIView subclass : - (void) doMyCoolAnimation { CABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@"position.x"]; anim.duration = 4; [self.layer setValue:@200 forKeyPath:anim.keyPath]; [self.layer addAnimation:anim forKey:nil]; } - (CGFloat) currentX { CALayer* presLayer = self.layer.presentationLayer; return presLayer.position.x; } When I use [self currentX] while the animation is running, I get 200 (the end value) rather than a value between 0

UIView.layer.presentationLayer returns final value (rather than current value)

≯℡__Kan透↙ 提交于 2021-02-08 10:52:46
问题 Here's some relevant code inside a UIView subclass : - (void) doMyCoolAnimation { CABasicAnimation* anim = [CABasicAnimation animationWithKeyPath:@"position.x"]; anim.duration = 4; [self.layer setValue:@200 forKeyPath:anim.keyPath]; [self.layer addAnimation:anim forKey:nil]; } - (CGFloat) currentX { CALayer* presLayer = self.layer.presentationLayer; return presLayer.position.x; } When I use [self currentX] while the animation is running, I get 200 (the end value) rather than a value between 0