Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/112.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios Can';不要把笔尖装成捆_Ios_Objective C_Cocoapods_Nib_Nsbundle - Fatal编程技术网

Ios Can';不要把笔尖装成捆

Ios Can';不要把笔尖装成捆,ios,objective-c,cocoapods,nib,nsbundle,Ios,Objective C,Cocoapods,Nib,Nsbundle,我知道还有其他一些问题与这个问题非常相似,但似乎没有什么能帮助我 我通过cocoapods包含了一个库,其中包含一个带有.xib文件的资源包。当我从该库调用一个方法时,会调用: dispatch_once(&pred, ^{ NSBundle *posBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"ClipPOSLibrar

我知道还有其他一些问题与这个问题非常相似,但似乎没有什么能帮助我

我通过cocoapods包含了一个库,其中包含一个带有.xib文件的资源包。当我从该库调用一个方法时,会调用:

dispatch_once(&pred,
              ^{
                  NSBundle *posBundle = [NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"ClipPOSLibrary" ofType:@"bundle"]];
                  sharedInstance = (POSReaderAlert*)[posBundle loadNibNamed:@"POSReaderAlert" owner:self options:nil][0];
                  sharedInstance.yCenterOffsetPercentage = 0;
                  sharedInstance.batteryThresholds = @[@(1), @(5), @(10), @(20)];
                  sharedInstance.currentThreshold = 3;
                  [[NSNotificationCenter defaultCenter] addObserver:sharedInstance
                                                           selector:@selector(handleRotation:)
                                                               name:UIApplicationDidChangeStatusBarOrientationNotification
                                                             object:nil];
              });
我在“sharedInstance=(POSReder….)”行上收到一个抛出的异常。这是一个异常:

Could not load NIB in bundle: 'NSBundle </var/mobile/Containers/Bundle/Application/F41CE11A-1E7A-4902-83F2-285CC2508D41/EMV-Flow-Example.app/ClipPOSLibrary.bundle> (not yet loaded)' with name 'POSReaderAlert'
无法在名为“POSReaderAlert”的捆绑包中加载NIB:“NSBundle(尚未加载)”
我已经确保在构建库时,nib选择了正确的目标,并且它包含在任何需要的地方。奇怪的是,我并不总是会出现这种错误。我用同一个库构建项目,所有东西似乎都可以正常工作,但在其他项目中没有。所以我猜我正在做一些事情项目配置/设置有误,但我真的不知道是什么

非常感谢您的帮助

*更新* 因此,我解决了iOS 6和iOS 7的问题,通过修正目标设置以使用一个好的xcconfig文件,这需要完成,因为工作区有点不稳定,其中包含三个不同的项目。但问题仍然发生在iOS 8上。有什么想法吗