自昨天升级到Lion(10.6-> 10.7)以来,我一直无法编译在升级之前编译没有问题的项目.
这个项目最近的变化甚至不会导致这个错误:如果我从几天或一周前从SVN签出一个项目版本,我在构建时会遇到同样的错误:
"Command /Developer/usr/bin/momc failed with exit code 6"
,扩展到以下内容:
DataModelVersionCompile /Users/ian/Library/Developer/Xcode/DerivedData/inventory-gtvznzuhomhlakbdpocaqwnrihhx/Build/Products/Debug-iphonesimulator/inventory.app/inventory.momd inventory/inventory.xcdatamodeld
cd /Users/ian/AppsDev/uk.co.isurvey-inventory/ios/inventory/trunk/inventory
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/usr/bin/momc -XD_MOMC_SDKROOT=/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.3.sdk -XD_MOMC_IOS_TARGET_VERSION=4.3 -MOMC_PLATFORMS iphonesimulator -MOMC_PLATFORMS iphoneos -XD_MOMC_TARGET_VERSION=10.6 /Users/ian/AppsDev/uk.co.isurvey-inventory/ios/inventory/trunk/inventory/inventory/inventory.xcdatamodeld /Users/ian/Library/Developer/Xcode/DerivedData/inventory-gtvznzuhomhlakbdpocaqwnrihhx/Build/Products/Debug-iphonesimulator/inventory.app/inventory.momd
2011-07-21 19:24:44.954 momc[4436:a0b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSXMLDocument initWithData:options:error:]: nil argument'
*** First throw call stack:
(
0 CoreFoundation 0x00007fff8e411986 __exceptionPreprocess + 198
1 libobjc.A.dylib 0x00007fff8d0d5d5e objc_exception_throw + 43
2 CoreFoundation 0x00007fff8e4117ba +[NSException raise:format:arguments:] + 106
3 CoreFoundation 0x00007fff8e411744 +[NSException raise:format:] + 116
4 …
Run Code Online (Sandbox Code Playgroud) 我正在使用此代码
if (managedObject == nil) {
NSLog(@"foooo");
}
Run Code Online (Sandbox Code Playgroud)
测试创建的managedObject是否为nil.但我永远不能打印这个Fooooo.你知道我做错了什么吗?
我创建一个空白模板包:
\n> swift package init --name Temp\n> open Package.swift\n
Run Code Online (Sandbox Code Playgroud)\nXcode 版本 13.2.1 (13C100) 打开该包。
\n我向包添加了依赖项。
\ndependencies: [\n .package(url: "https://github.com/johnsundell/publish.git", from: "0.7.0")\n],\n
Run Code Online (Sandbox Code Playgroud)\n此时 Xcode > Product > Build 成功。
\n我编辑Temp/Sources/Temp/Temp.swift
以插入在 中定义的包的第一行dependencies
。
import Publish\n
Run Code Online (Sandbox Code Playgroud)\n现在构建会生成以下错误:\xe2\x80\xa6/Temp/Sources/Temp/Temp.swift:1:8: error: no such module \'Publish\'
。
我确信这是苹果的一个错误。或者我可能会错过一些东西。
\n当有xcodeproj
和 提供的附加结构时,有几篇关于此问题的帖子。其中一些暗示了可以帮助某些人的解决方法。
有没有人看到过这个和/或知道如何解决它?
\nApple 的使用 Xcode 创建独立的 Swift 包文档没有提供任何见解。
\niOS 6.0,在iPhone 5上测试
我正在UICollectionViewController
从一个笔尖加载一个子类.当我加热awakeFromNib
方法时,它声称视图已加载.致电collectionView
回报nil
.
因此,我在注册加载我的细胞的笔尖时遇到了问题.
- (void)awakeFromNib {
if ([self isViewLoaded])
NSLog(@"[%@ %@] registered with %@", NSStringFromClass([self class]), NSStringFromSelector(_cmd),
self.collectionView);
UINib *nib = [UINib nibWithNibName:@"MyCollectionCell" bundle:nil];
[self.collectionView registerNib:nib forCellWithReuseIdentifier:NIB_ID];
}
Run Code Online (Sandbox Code Playgroud)
上面的输出:
2012-09-22 19:21:49.129 myApp[7182:907] [MyCollectionViewController awakeFromNib] registered with (null)
Run Code Online (Sandbox Code Playgroud)
此外,loadView
并且viewDidLoad
不会被调用(从笔尖加载时预期).
尝试加载单元格时,我失败了.
当前的解决方法,冗余注册nib collectionView:cellForItemAtIndexPath:
:
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
UINib *nib = [UINib nibWithNibName:@"MyCollectionCell" bundle:nil];
[collectionView registerNib:nib forCellWithReuseIdentifier:NIB_ID];
Run Code Online (Sandbox Code Playgroud)
问题:你遇到过这个问题吗?你看到我的方式错误了吗?这是一个已知的错误?
编辑:附加信息......
在awakeFromNib中断,collectionView
似乎无法访问
(lldb) …
Run Code Online (Sandbox Code Playgroud)