我使用以下命令安装了Polymer:
bower init
bower install --save Polymer/polymer#^1.1.0
bower install --save PolymerElements/paper-elements
它创建了一个名为bower_components的子文件夹。但是在我将它们复制到不同的子文件夹之前,没有找到任何文件,然后一切都开始工作了。
为什么?
答案 0 :(得分:1)
– (void)loadView {
NSString *nibPath = nil;
NSBundle *nibBundle = [self nibBundle];
if (nibBundle == nil) {
nibBundle = [NSBundle mainBundle];
}
NSString *nibName = self.nibName;
if (nibName != nil) {
nibPath = [nibBundle pathForResource:nibName ofType:@”nib”];
}
if (nibPath != nil && [[NSFileManager defaultManager] fileExistsAtPath:nibPath]) {
[super loadView]; <<<< exc_bad_access here!
} else {
// One of the requirements of loadView is that a valid view object is set to
// self.view upon completion. Otherwise, subclasses that attempt to
// access self.view after calling [super loadView] will enter an infinite
// loop due to the fact that UIViewController's -view accessor calls
// loadView when self.view is nil.
self.view = [[[UIView alloc] init] autorelease];
#if DEBUG
NSLog(@"missing %@.nib", nibName);
#endif
}
}
时会创建 bower_components
。 bower install
中的所有代码都将在此处下载。
答案 1 :(得分:1)
也许您想在&#34;不同的子文件夹中安装您的bower组件&#34;默认情况下。这可以使用.bowerrc中的以下内容完成:
{
"directory": "some/directory"
}
希望有所帮助。