小编Bob*_*ork的帖子

Xcode 4 - 铿锵错误

我正在从Xcode 3.5迁移到Xcode 4,而我正在尝试存档我的应​​用程序以进行AdHoc分发.
我收到了这个错误

预编译MyApp_Prefix.pch

ProcessPCH /Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/Build/PrecompiledHeaders/MyApp_Prefix-crxrbmeralwexyefvuwvzexquuin/MyApp_Prefix.pch.pth MyApp_Prefix.pch normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
cd /Users/return/Projects/iphone-MyApp
setenv LANG en_US.US-ASCII
setenv PATH "/Xcode4.2/Platforms/iPhoneOS.platform/Developer/usr/bin:/Xcode4.2/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Xcode4.2/Platforms/iPhoneOS.platform/Developer/usr/bin/clang -x objective-c-header -arch armv7 -fmessage-length=0 -fdiagnostics-print-source-range-info -fdiagnostics-show-category=id -fdiagnostics-parseable-fixits -std=c99 -Wno-trigraphs -fpascal-strings -O0 -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-shorten-64-to-32 -DFAVOURITES_ENABLED=0 -isysroot /Xcode4.2/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk -gdwarf-2 -fvisibility=hidden -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))" "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))" "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=3.0 -iquote "/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/MyApp-generated-files.hmap" "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/MyApp-own-target-headers.hmap" "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/MyApp-all-target-headers.hmap" -iquote "/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/MyApp-project-headers.hmap" "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/BuildProductsPath/Distribution-iphoneos/include" "-I”/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp" -I- "-IDistribution/BuildProductsPath/Distribution-iphoneos/../three20?" "-I“/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp" -I- "-IDistribution/BuildProductsPath/Distribution-iphoneos/../../three20?" -Ithree20/Build/Products/three20 -I/Xcode4.2/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/include/libxml2 "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp - Distribution/IntermediateBuildFilesPath/MyApp.build/Distribution-iphoneos/MyApp.build/DerivedSources/armv7" "-I/Users/return/Library/Developer/Xcode/DerivedData/MyApp-cwtxjgdpsvtoyxcfpytllmzaxceb/ArchiveIntermediates/MyApp …
Run Code Online (Sandbox Code Playgroud)

iphone objective-c ios xcode4.2

15
推荐指数
1
解决办法
7万
查看次数

NSFileWrapper,延迟加载和保存

我有一个基于NSDocument的应用程序,它使用filewrappers来保存和加载其数据.该文档可以拥有各种资源,因此我不想将所有内容加载到内存中.我可能会做一些根本错误的事情,但是一旦我更改了一个(内部)文件然后保存,我就无法读取任何尚未加载到内存中的文件.

我已将相关代码分离到一个单独的项目中以重现此行为,并得到相同的结果.基本流程如下:

  • 我从磁盘加载现有文档.主fileWrapper是一个目录filewrapper(我称之为main),包含另外两个filewrappers(sub1sub2).此时加载两个内部文件包装器.
  • 当用户想要编辑sub1时,它将从磁盘加载.
  • 用户保存文档
  • 如果用户想要编辑其他文件(sub2),则无法加载.出现的错误:

    -[NSFileWrapper regularFileContents] tried to read the file wrapper's contents lazily but an error occurred: The file couldn’t be opened because it doesn’t exist.
    
    Run Code Online (Sandbox Code Playgroud)

这是我项目中的相关代码:

此代码可能更容易阅读这个要点:https: //gist.github.com/bob-codingdutchmen/6869871

#define FileName01 @"testfile1.txt"
#define FileName02 @"testfile2.txt"

/**
 *  Only called when initializing a NEW document
 */
-(id)initWithType:(NSString *)typeName error:(NSError *__autoreleasing *)outError {
    self = [self init];
    if (self) {
        self.myWrapper = [[NSFileWrapper alloc] initDirectoryWithFileWrappers:nil]; …
Run Code Online (Sandbox Code Playgroud)

macos cocoa objective-c nsdocument nsfilewrapper

13
推荐指数
1
解决办法
2086
查看次数

GitPython:如何提交更新的子模块

我已经在这几个小时了,虽然我有一种感觉,我很接近我似乎无法解决这个问题.

我正在尝试创建一个带有git存储库的脚本,将该存储库中的子模块更新为指定版本,并提交更改.

什么有效:

我可以找到存储库,获取子模块并检查我想要的提交.

什么行不通:

我似乎无法添加更新的子模块哈希,所以我可以提交它.

我的代码:

repos = Repo('path/to/repos')
submodule = repos.submodule('submodule-name')
submodule.module().git.checkout('wanted commit')

diff = repos.index.diff(None)
Run Code Online (Sandbox Code Playgroud)

此时我可以看到子模块的变化.如果我检查sourcetree,我可以在'unstaged files'中看到更改的子模块.问题是,我不知道如何进行更改以便我可以提交.

我尝试过的:

  • 如果我提交使用repos.index.commit(''),它会创建一个空提交.
  • 如果我尝试使用子模块添加路径,则子模块中的repos.index.add([submodule.path])所有文件都会添加到存储库中,这肯定不是我想要的.
  • 如果我尝试添加子模块本身(应该可以根据文档使用)repos.index.add([submodule]),似乎没有任何事情发生.

python git git-submodules gitpython

10
推荐指数
1
解决办法
1223
查看次数

"使用Xcode bot构建时,没有规则来处理文件......对于架构i386"

我为我的iOS XCode项目设置了持续集成,但是当Xcode bot构建我的项目时,我不断收到很多警告.当我构建(用于运行,测试或存档)时,我没有得到任何警告.

我认为这与我的项目设置有关.我的主项目中有一个'内部'项目,包含我需要的库.我正在为i386架构构建两个项目,因此它可以在模拟器中运行(因此Xcode机器人可以运行测试).

确切的警告如下.我对.m内部项目中的每个文件都收到此警告.

Warning: no rule to process file '[…]/CDICMessage.m' of type sourcecode.c.objc for architecture i386
Run Code Online (Sandbox Code Playgroud)

大多数关于此警告的Google结果都是针对.h错误添加到"编译源"的.m文件,但显然我的文件应该在那里.

同样,此警告仅显示在Xcode服务器上,本地构建很好.构建是正常的,否则测试成功并构建存档.最大的问题是警告堆会淹没项目可能产生的任何其他警告.

xcode continuous-integration ios xcode-bots xcode-server

8
推荐指数
1
解决办法
4536
查看次数