草庐IT

Objective-c

全部标签

iOS 音频单元,将每个立体声 channel 从立体声源输出到 3D 混音器

Apple的3DMixerAudioUnit指南指出:Touseastereosource,youmaytreatitsleftandrightchannelsastwoindependentsingle-channelsources,andthenfeedeachsideofthestereostreamtoitsowninputbus.https://developer.apple.com/library/ios/qa/qa1695/_index.html但是,我不知道如何将我的立体声音频单元的每个channel发送到3D混音器中。如何做到这一点? 最佳

ios - stub [[SomeClazz alloc] init] 不工作但接受的答案说它应该工作

我测试的功能很简单:@implementationMyHandler...-(void)processData{DataService*service=[[DataServicealloc]init];NSDictionary*data=[servicegetData];[selfhandleData:data];}@end我使用OCMock3对其进行单元测试。我需要stub[[DataServicealloc]init]以返回一个模拟实例,我尝试了answerfromthisquestion(这是一个公认的答案)stub[[SomeClazzalloc]init]://Stub'al

ios - 更改从 UIActivityViewController 打开的模态视图 Controller 的状态栏文本颜色

我们如何更改从UIActivityViewController中选择事件(邮件、消息等)后打开的模态视图Controller的颜色。我尝试将Statusbarstyle设置为UIStatusBarStyleLightContent但它没有用。Viewcontroller-basedstatusbarappearance设置为NO。我的应用程序有许多UIViewController,我需要状态栏文本的颜色为白色,而在某些应用程序中,我需要它为黑色并且我需要状态栏文本的颜色从UIActivityViewController打开事件时为白色。如何实现?我尝试了来自here的东西以下列方式-[

ios - 单击左右按钮时将 CollectionView 的单元格向左和向右滚动

实际上我有像这样的UICollectionView的可见单元格-(void)scrollViewDidEndDecelerating:(UIScrollView*)scrollView{for(UICollectionViewCell*cellin[self.obj_CollectionView1visibleCells]){NSIndexPath*indexPath=[self.obj_CollectionView1indexPathForCell:cell];lastIndex=[indexPathindexAtPosition:[indexPathlength]-1];if(la

ios - 使用 AFNetworking 3.0,我的应用程序有一些内存泄漏

我在我的应用程序中使用AFNetworking3.0,发现内存泄漏。代码:letmanager=AFHTTPSessionManager()manager.POST("",parameters:nil,progress:{(progress:NSProgress)in},success:{(task:NSURLSessionDataTask,objects:AnyObject?)in}){(task:NSURLSessionDataTask?,error:NSError)in}+(instancetype)manager{return[[[selfclass]alloc]initWit

ios - 无法验证 : Could not find a CFBundlePackageType

我正在尝试使用Xcode将我的iOSapparchive上传到iTunesConnect,但是当我点击“上传到AppStore”时,出现错误:"CouldnotfindaCFBundlePackageTypewithintheinfo.plist;orthepackageismissinganInfo.plist"在我的info.plist中我有:-BundleOSTypecode:APPL-BundlecreatorOSTypecode:APPL那个配置有什么问题?我的应用程序是为iPad和iPhone创建的 最佳答案 我找到了解

ios - 如何从 UIImagePickerController 获取 1080p 视频?

当我使用UIImagePickerController导入1080p视频时,询问它的大小是多少,它报告说只有720p。这是我打开图像选择器的方式:letpicker=UIImagePickerController()picker.sourceType=.PhotoLibrarypicker.videoQuality=.TypeHighpicker.allowsEditing=falsepicker.delegate=selfpicker.modalPresentationStyle=.Popoverpicker.popoverPresentationController?.source

ios - 使用 XCTestExpectation 单元测试异步函数,但它不会等待我设置的秒数

我有一个MyService类继承了NSThread:标题:@interfaceMyService:NSThread{-(void)startMe;-(void)doTask;...}实现:@implementationMyService-(void)startMe{[selfstart];}-(void)doTask{[selfperformSelector:@selector(checkData:)onThread:selfwithObject:nilwaitUntilDone:YES];}-(void)checkData{...//NOTE:dataCheckedisaninsta

ios - Objective C Table Cell ContentView view hierarchy is not prepared for the constraint

Storyboard我在表中添加了一个带有Storyboard的标签(约束顶部:10左:0右:0)一个标签。根据状态,如果想创建图像并添加约束,我会收到此错误:2016-06-1716:02:59.235Cellin[3748:162565]***Terminatingappduetouncaughtexception'NSInvalidArgumentException',reason:'***+[NSLayoutConstraintconstraintWithItem:attribute:relatedBy:toItem:attribute:multiplier:constant:

ios - 使用图像 I/O Objective-C 加载原始图像返回错误的分辨率

我正在尝试将RAW图像加载到iOS项目以进行显示。目前,我正在使用这段代码加载原始图像。CFDictionaryRefoptionsRef=(__bridgeCFDictionaryRef)@{//(id)kCGImageSourceShouldAllowFloat:@YES,(id)kCGImageSourceCreateThumbnailWithTransform:@YES,(id)kCGImageSourceCreateThumbnailFromImageAlways:@YES,(id)kCGImageSourceThumbnailMaxPixelSize:@(MAX(SCREE