Xcode 4仍然是我开发iOS的主要IDE.为了尝试即将推出的iOS 7,我安装了Xcode 5 Developer Preview,现在所有用于在Xcode 4中打开的文件现在都在Xcode 5中打开.
如何在不卸载Xcode 5的情况下将Xcode 4恢复为默认编辑器?
在我的Localizable.strings中,我定义了一个带有尾随空格的字符串,如下所示:
"%@ points " = "%@ Punkte ";
Run Code Online (Sandbox Code Playgroud)
这在iOS6中运行得很好但是当在iOS7模拟器上运行时,字符串被修剪并且尾随的空格被剥离.
背景:上面的字符串在标签中右对齐.我使用空格作为填充,因为我不想为UILabel创建子类或只为一个标签编写一堆代码.
我也尝试过使用ASCII标志,但这也行不通.
任何关于简单灵魂的建议都将受到赞赏.
谢谢!
我一直在重构一些代码并创建了一个静态库,我现在正在一些用于少数应用程序的框架中使用.我正在使用cocoapods,并且无法正确地将我的新静态库集成到podspec中.
我发现构建失败了,因为构建中缺少静态库.如果我手动将静态库添加到最终应用程序,框架和应用程序工作正常.构建团队生成应用程序的最终版本,因此我只负责更新框架的podspec.
我是否可以修改pod规范以将静态库设置为在最终应用程序的构建阶段显示的链接库?
更新:
将静态库添加到我的子规范的framework.library属性时,我得到了 library not found for -lMyStaticLib
SUBSPEC供参考:
s.subspec 'MyStaticLibrary' do |msl|
mss.source_files = 'FrameworkSource/My-Static-Library/*.{h,a}'
msl.library = 'MyStaticLib'
msl.xcconfig = { 'HEADER_SEARCH_PATHS' => '"$(SRCROOT)/Pods/My-Framework-Name/FrameworkSource/My-Static-Library"/**', 'LIBRARY_SEARCH_PATHS' => '"$(SRCROOT)/Pods/My-Framework-Name/FrameworkSource/My-Static-Library"/**' }
#msl.frameworks = 'MyStaticLib'
end
Run Code Online (Sandbox Code Playgroud)
更新2:我将属性更改为msl.vendored_libraries = 'MyStaticLib'podspec中的已验证路径.一切似乎都要结束.我仍然遇到构建错误.当我为一个设备构建时(我在为模拟器构建时得到了相同的错误,但对于i386):
Undefined symbols for architecture armv7:
"_OBJC_CLASS_$_MyStaticLibrary", referenced from:
objc-class-ref in MyFramework(FileInFramework.o)
ld: symbol(s) not found for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud)
我还再次验证,如果我只是去应用程序的构建阶段并遍历Pods文件夹并手动将MyStaticLibrary.a文件添加到它构建的项目中而没有问题.
我的故事板有问题.它工作正常但是当我尝试更改UITableView的内容属性时导致以下错误
断言失败 - [UITableView dequeueReusableCellWithIdentifier:forIndexPath:],/ SourceCache/UIKit/UIKit-2903.23/UITableView.m由于未捕获的异常'NSInternalInconsistencyException'而终止应用程序,原因:'无法使用标识符Cell将单元格出列 - 必须注册一个笔尖或标识符的类或连接故事板中的原型单元格'
我想用静态单元格设计一个分组的tableview.Thanks提前
码
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 3;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
return cell;
}
Run Code Online (Sandbox Code Playgroud) 我正在尝试打开一个使用iOS 6.0构建的旧项目.该项目用于编译正常,但在xCode 5下打开时,我得到这个神秘的错误消息.
Unsupported compiler 'com.apple.compilers.llvmgcc42' selected for architecture 'armv7'
Unable to determine concrete GCC compiler for file /Users/alexanderstone/Desktop/Development/RestKit/Vendor/NXJSON/NSError+Extensions.m of type sourcecode.c.objc.
Unable to determine concrete GCC compiler for file /Users/alexanderstone/Desktop/Development/RestKit/Vendor/NXJSON/NXDebug.m of type sourcecode.c.objc.
Unable to determine concrete GCC compiler for file /Users/alexanderstone/Desktop/Development/RestKit/Vendor/NXJSON/NXJsonParser.m of type sourcecode.c.objc.
Unable to determine concrete GCC compiler for file /Users/alexanderstone/Desktop/Development/RestKit/Vendor/NXJSON/NXJsonSerializer.m of type sourcecode.c.objc.
Run Code Online (Sandbox Code Playgroud)
我已经检查了两个项目构建设置,它们看起来是正确的 - LLVM 5.0被选为两者的编译器.


另外,我检查了编译器抱怨的.m文件,并且没有看到任何对GCC的引用.有一些ASSERT()和其他宏,但我不知道它们是否是特定于编译器的.
当所有子项目似乎都设置为llvm5.0时,如何解决xCode 5中缺少的llvmgcc4.2编译器?
我正在修复核心数据模型.我创建了一个新的模型版本,并修复了导致警告的所有条件.我仍然会收到旧版本的警告.
我正在寻找摆脱/隐藏这些警告的最佳方法,而不会影响项目范围内的警告显示
使用CLLocation对象(内容例如纬度= 48.196169,经度= 11.620237),我尝试获取当前的城市和国家:
if(!geocoder) {
geocoder = [[CLGeocoder alloc] init];
}
if (geocoder.geocoding) [geocoder cancelGeocode];
[geocoder reverseGeocodeLocation:lo completionHandler:^(NSArray *placemarks, NSError *error) {
if(devMode) {
NSLog(@"Found placemarks: %@, error: %@", placemarks, error);
}
if (error == nil && [placemarks count] > 0) {
// MY CODE - here placemarks is always (null)
} else {
if(devMode)
NSLog(@"%@", error.debugDescription);
}
}];
Run Code Online (Sandbox Code Playgroud)
大多数情况下,这很有效.但在极少数情况下,我只是得到错误:
PBRequester失败,错误错误域= NSURLErrorDomain代码= -1000"UngültigeURL"UserInfo = 0x16f5ff30 {NSUnderlyingError = 0x16f57810"UngültigeURL",NSLocalizedDescription =UngültigeURL}
找到地标:(null),错误:错误Domain = kCLErrorDomain Code = 2"操作无法完成.(kCLErrorDomain error 2.)"
我完全不知道为什么会这样.
在Xcode中运行C++程序时出现问题.总会有会话说Debug xxx,但这不能停止.代码没有问题.
这里有一些截图:


当我尝试在设备上加载我的应用程序时,有时我会遇到异常
dyld`gdb_image_notifier:0x2beca0cc:bx lr
但在停止并再次运行后一切正常,任何人都可以告诉我为什么会发生这种情况