Próbuję modularyzować duży projekt iOS (rozwijany w Swift) przy użyciu strąków kakao. Chodzi o stworzenie "sub-aplikacji" wraz ze scenorysami i zasobami, które można zintegrować z głównym projektem.Używanie scenariuszy i zasobów obrazu w niestandardowych kokosach
Mam problemy z używanie scenorysów w takim scenariuszu. Problem jest podobny do (chyba): https://github.com/CocoaPods/CocoaPods/issues/2597
Oto .podspec modułu staram się przekształcić w strąku:
Pod::Spec.new do |spec|
spec.name = 'GlycoAppMenuModule'
spec.version = '0.0.8'
spec.license = { :type => 'MIT', :file => 'LICENSE' }
spec.homepage = 'https://google.com'
spec.platform = :ios, "8.0"
spec.authors = { 'Abdulla Contractor' => '[email protected]' }
spec.summary = 'Views for menu page'
spec.source = { :git => 'https://github.com/Holmusk/GlycoAppMenuModule.git', :tag => '0.0.8' }
spec.source_files = 'GlycoAppMenuModule/*'
spec.resource_bundles = {
'resources' => ['GlycoAppMenuModule/**/*.{lproj,storyboard}']}
# spec.framework = 'Foundation'
end
i Oto kod używam próba używać serii ujęć
let bundlePath = NSBundle(forClass: GANavigationMenuViewController.self).pathForResource("resources", ofType: "bundle")
let bundle = NSBundle(path: bundlePath!)
let storyboard: UIStoryboard = UIStoryboard(name: "Menu", bundle: bundle)
let vc = storyboard.instantiateInitialViewController() as! UIViewController
self.presentViewController(vc, animated: false, completion: nil)
to błąd pojawia się
2015-06-05 11:39:40.365 temp[3593:50802] Unknown class _TtC9resources30GANavigationMenuViewController in Interface Builder file.
2015-06-05 11:39:40.370 temp[3593:50802] Could not load the "icAccount.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.371 temp[3593:50802] Could not load the "icConnect.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.371 temp[3593:50802] Could not load the "icDiabetesProfile.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.373 temp[3593:50802] Could not load the "icLogout.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.377 temp[3593:50802] Could not load the "icCircle.png" image referenced from a nib in the bundle with identifier "(null)"
2015-06-05 11:39:40.386 temp[3593:50802] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7fb3f3d2cdd0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key accountButton.'
Jakiś pomysł, czego może mi brakować?
Wygląda na podobny problem http://stackoverflow.com/questions/3088059/what-does-this-mean-nsunknownkeyexception-reasonthis-class-is-not-key-valu –