草庐IT

avcodec_alloc_context

全部标签

ios - CoreData 嵌套上下文 : what is the proper way to save context?

我正在使用嵌套上下文模式来支持CoreData的多线程工作。我有CoredDataManager单例类,上下文的初始化是:self.masterContext=[[NSManagedObjectContextalloc]initWithConcurrencyType:NSPrivateQueueConcurrencyType];self.masterContext.persistentStoreCoordinator=self.persistentStoreCoordinator;self.mainContext=[[NSManagedObjectContextalloc]initWi

ios - 将 NSString 转换为 NSAttributedString 无需 alloc init

我想将NSString转换成NSAttributedString。但我总是要做NSAttributedString*useDict1=[[NSAttributedStringalloc]initWithString:@"String"];有没有其他方法可以让我不必每次都分配Dictionary,而只需提供字符串? 最佳答案 我建议在NSString上创建一个类别,使用一种将其转换为NSAttributedString的方法,然后在您的项目中使用该辅助方法。像这样:@interfaceNSString(AttributedString

android - java.lang.NoSuchMethodError : No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)

将我的AndroidStudio更新到3.0后,我收到NostaticmethodgetFont()错误。我正在从事的项目在github上,https://github.com/ik024/GithubBrowser//Top-levelbuildfilewhereyoucanaddconfigurationoptionscommontoallsub-projects/modules.buildscript{repositories{jcenter()maven{url"https://oss.sonatype.org/content/repositories/snapshots"}}

android - java.lang.NoSuchMethodError : No static method getFont(Landroid/content/Context;ILandroid/util/TypedValue;ILandroid/widget/TextView;)

将我的AndroidStudio更新到3.0后,我收到NostaticmethodgetFont()错误。我正在从事的项目在github上,https://github.com/ik024/GithubBrowser//Top-levelbuildfilewhereyoucanaddconfigurationoptionscommontoallsub-projects/modules.buildscript{repositories{jcenter()maven{url"https://oss.sonatype.org/content/repositories/snapshots"}}

ios - 调用 alloc init 时 UIImagePickerController 真的很慢

我有一个ViewController,它在按下tabBarController中的一个选项卡时显示。在这个ViewController中,我在viewDidLoad方法中初始化了一个UIImagePickerController:-(void)viewDidLoad{[superviewDidLoad];//SetimagePicker//-------------------------//_imagePicker=[[UIImagePickerControlleralloc]init];_imagePicker.delegate=self;_imagePicker.videoMax

objective-c - 我们可以覆盖 Objective-C 中的 alloc 和 dealloc 吗?

我知道很少需要重写alloc或dealloc方法,但如果需要,在iPhone编程中是否可行? 最佳答案 你可以而且确实应该(如果使用手动内存管理)覆盖dealloc以释放你持有的任何资源(不要忘记在完成时调用[superdealloc]).覆盖alloc是可能的,但正如您所说,很少需要。 关于objective-c-我们可以覆盖Objective-C中的alloc和dealloc吗?,我们在StackOverflow上找到一个类似的问题: https://st

iOS 11 [MediaRemote] [AVOutputContext] 警告 : AVF context unavailable for MRAVOutputContextCreateIndependentRoutingContext

我在iOS应用程序中使用视频播放器(框架MediaPlayer)。如果我将设备旋转为横向,视频不会旋转为横向。仅在iOS11上没有视频旋转。iOS9、10-旋转良好。在启动视频播放器之前和设备旋转时,XCode收到消息:[MediaRemote][AVOutputContext]WARNING:AVFcontextunavailableforMRAVOutputContextCreateIndependentRoutingContext旋转视频怎么办? 最佳答案 当我删除所有断点后,我的问题就解决了。也许您可以尝试一下,希望它也能为

ios - 核心数据 : Parent context and change propagation

我的应用程序中有以下核心数据设置:PersistentStoreCoordinator^BackgroundMOC(NSPrivateQueueConcurrencyType)^MainQueueMOC(NSMainQueueConcurrencyType)初始化代码如下:_backgroundContext=[[NSManagedObjectContextalloc]initWithConcurrencyType:NSPrivateQueueConcurrencyType];[_backgroundContextsetPersistentStoreCoordinator:self.c

ios - 从 Core Data Managed Object Context 中删除插入但未保存的对象

有没有办法删除已插入上下文但尚未保存的单个托管对象?我想删除单个对象,而不是回滚整个上下文。我试过调用deleteObject:但它抛出异常,因为根据核心数据,该对象在MOC中尚不存在。通过查看核心数据的insertedobjects属性,我肯定知道它已被插入,通过查看deleted对象,我知道它已被标记为删除。本质上我想“取消插入”该对象。先保存再删除是NotAcceptable。谢谢。 最佳答案 事实证明,对尚未持久化的对象调用deleteObject:是完全合法的。根据Apple的文档:Ifobjecthasnotyetbee

IOS 警告 : Unable to allocate render buffer storage

我有一个简单的IOS应用程序。它包括两个工具栏和mapView。我只使用默认库(没有cocoa等)。当我在真正的iPhone5s(IOS8.1)上调试我的应用程序时,当iPhone改变方向时,我的控制台中出现“无法分配渲染缓冲区存储!0x1741f2c00”(模拟器没问题)。状态栏在真实设备和模拟器上变成横向时消失,当纵向时返回(这是我的普遍问题)。应用订阅UIDeviceOrientationDidChangeNotification。[[UIDevicecurrentDevice]beginGeneratingDeviceOrientationNotifications];[[NS