草庐IT

ios - 核心数据 NSFetchedResultsController 和批量大小设置加载所有行

我的核心数据数据库中有数千个点,我想将所有这些点都放在我的tableView中,但我不想一次将它们全部提取到内存中,但我想使用NSFetchedResultsController并用一些常量对它们进行批处理。我设置它就像我在许多教程中看到的那样,我设置了fetchBatchSize属性但是在显示之前加载ViewController需要几秒钟。这个函数在viewDidLoad中被调用:-(void)initPositionsFetch{//InitializeFetchRequestNSFetchRequest*fetchRequest=[[NSFetchRequestalloc]ini

ios - beginReceivingRemoteControlEvents 不触发 Apple Music 的事件

我正在从我的应用程序播放AppleMusic,Apple音乐播放器代码如下--(void)submitAppleMusicTrackWithProductID:(NSString*)productID//productIDinUSisthelastnumbersafteri=intheshareURLfromAppleMusic{[SKCloudServiceControllerrequestAuthorization:^(SKCloudServiceAuthorizationStatusstatus){NSLog(@"statusis%ld",(long)status);SKClou

ios - iPhone 中的总内存

我想知道我的iPhone中可用的总RAM。为此,我使用了以下代码。注意:请不要将问题解释为检索RAM统计信息,例如Wired、Inactive、Active和Free。mach_port_thost_port;mach_msg_type_number_thost_size;vm_size_tpagesize;host_port=mach_host_self();host_size=sizeof(vm_statistics_data_t)/sizeof(integer_t);host_page_size(host_port,&pagesize);vm_statistics_data_tv

ios - 控制台中显示的 ADBannerView 未处理错误

我按照苹果开发指南文档以编程方式在我的iOS应用程序上添加iAd。虽然我在stackoverflow上搜索了以前的解决方案,但不幸的是它们似乎都没有帮助我。这是以下错误:iAdBannerfailed[AppDeveloper]ADBannerView:Unhandlederror(nodelegateordelegatedoesnotimplementdidFailToReceiveAdWithError:):ErrorDomain=ADErrorDomainCode=7"Theoperationcouldn’tbecompleted.Adwasunloadedfromthisban

ios - 为什么信标会导致蓝牙不断切换?

我在使用iOS和iBeacon时遇到了一个非常奇怪的错误。我有一个非常简单的BeaconManager,它使用特定的UUID、主要和次要值来排列信标,并在找到它们后执行一些操作。我的应用程序似乎可以正常工作,直到它不断切换蓝牙状态并停止工作。唯一可见的结果是由于蓝牙停止和重启,状态栏中的蓝牙图标开始闪烁。注意力应该放在哪里?这是我的类定义:#import"BeaconManager.h"@implementationBeaconManager-(instancetype)init{self=[superinit];if(self){NSURL*beep=[[NSBundlemainBu

ios - 无法更改 UICollectionView 上的 backgroundView 属性

我有一个UICollectionView,我正在尝试根据CollectionView中是否有任何数据使用backgroundView属性设置背景图像。我有导航将更改数据,并重新加载CollectionView(调用[self.collectionViewreloadData])。出于某种原因,我得到了非常奇怪的结果。首先,有时当我设置属性时,它会出现在collectionView单元格的顶部并遮住它们。其次,当我尝试更改属性时,它不会在屏幕上更改。这让我抓狂!实现起来似乎很简单!所以在代码中。在viewDidLoad中为UICollectionViewController-(void)

ios - 加载 Adob​​e Illustrator(.ai) 文件

是否可以加载.ai文件并以编程方式打开它们?这是我试过的:-(IBAction)openDocument:(id)sender{QLPreviewController*previewController=[[QLPreviewControlleralloc]init];[previewControllersetDataSource:self];[previewControllersetDelegate:self];[selfpresentModalViewController:previewControlleranimated:YES];}-(NSInteger)numberOfPre

ios - 使用 UISearchDisplayController 时,UICollectionView 中的 UISearchBar 消失

我将UISearchBar添加为UICollectionView的subview,并附加到UISearchDisplayController。我在viewDidLoad中设置:self.searchController=[[UISearchDisplayControlleralloc]initWithSearchBar:self.searchBarcontentsController:self];self.searchController.delegate=self;self.searchController.searchResultsDataSource=self;self.sear

ios - 没有可见的界面错误

我的模型的实现文件中有一个错误,我已将其注释掉。我该怎么做才能解决这个问题?提前致谢。#import"CalculatorBrain.h"@interfaceCalculatorBrain()@property(nonatomic,strong)NSMutableSet*operandStack;@end@implementationCalculatorBrain@synthesizeoperandStack=_operandStack;-(NSMutableArray*)operandStack{if(!_operandStack){_operandStack=[[NSMutable

ios - CLGeocoder 曾经返回一个地标

我要复活this和this问题,因为问题对我来说仍然存在,所以我正在写一个新问题。这是我的代码:-(SVGeocoder*)initWithParameters:(NSMutableDictionary*)parameterscompletion:(SVGeocoderCompletionHandler)block{self=[superinit];self.operationCompletionBlock=block;Classcl=NSClassFromString(@"CLGeocoder");if(cl!=nil){if(self.geocoder_5_1==nil){self