我创建了一个符合NSCoding的Swift类.(Xcode 6 GM,Swift 1.0)
import Foundation
private var nextNonce = 1000
class Command: NSCoding {
let nonce: Int
let string: String!
init(string: String) {
self.nonce = nextNonce++
self.string = string
}
required init(coder aDecoder: NSCoder) {
nonce = aDecoder.decodeIntegerForKey("nonce")
string = aDecoder.decodeObjectForKey("string") as String
}
func encodeWithCoder(aCoder: NSCoder) {
aCoder.encodeInteger(nonce, forKey: "nonce")
aCoder.encodeObject(string, forKey: "string")
}
}
Run Code Online (Sandbox Code Playgroud)
但是当我打电话给...
let data = NSKeyedArchiver.archivedDataWithRootObject(cmd);
崩溃给了我这个错误.
2014-09-12 16:30:00.463 MyApp[30078:60b] *** NSForwarding: warning: object 0x7a04ac70 of class '_TtC8MyApp7Command' does not implement methodSignatureForSelector: -- trouble …
Run Code Online (Sandbox Code Playgroud) 我正在使用Cocoapods 0.37.2,Xcode 6.3.2在Swift 1.2中进行iOS应用程序项目.在我的项目中添加大约8个pod后,应用程序启动时间在设备(iPhone 5)上大大增加(大约10秒钟).(注意:启动时间表示点击应用程序图标以打开应用程序的时间)
它是如此缓慢的iOS终止它,因为它没有及时启动.崩溃日志的顶部如下......
Application Specific Information: com.tryslowappswift failed to launch in time
Elapsed total CPU time (seconds): 27.720 (user 27.720, system 0.000), 68% CPU
Elapsed application CPU time (seconds): 0.074, 0% CPU
Thread 0:
0 dyld 0x1ff0f4c8 ImageLoaderMachOCompressed::rebase(ImageLoader::LinkContext const&) + 456
1 dyld 0x1ff087be ImageLoader::recursiveRebase(ImageLoader::LinkContext const&) + 174
2 dyld 0x1ff07dca ImageLoader::link(ImageLoader::LinkContext const&, bool, bool, bool, ImageLoader::RPathChain const&) + 186
3 dyld 0x1ff012fc dyld::link(ImageLoader*, bool, bool, ImageLoader::RPathChain const&) + 204
4 dyld 0x1ff022d6 dyld::_main(macho_header const*, unsigned long, …
Run Code Online (Sandbox Code Playgroud) 使用SDK 6.0更新Xcode会在尝试编译项目时出错.
缺少Retina 4发射图像.在Retina 4设备上以原始分辨率运行需要名为"Default-568@2x.png"的启动映像.你想要Xcode为你添加这个图片吗?
单击"添加"时,将创建大小为640x1136的黑色启动图像.我知道我可以轻松地用合适的图像替换这个图像.但XCode给了我一个错误,并迫使我有这个文件.如果我不想包含此内容,如何跳过此错误并仅使用较短的启动图像?
截图:http://spacetech.dk/xcode-missing-retina-4-launch-image.html
我已经pod trunk push
为podspec版本做了一个.我可以再次推它并覆盖现有的吗?我试了但是它给了我这个错误.
$ pod trunk push Parse-iOS-SDK.podspec
Validating podspec
-> Parse-iOS-SDK (1.2.21)
[!] Unable to accept duplicate entry for: Parse-iOS-SDK (1.2.21)
Run Code Online (Sandbox Code Playgroud)
是否有类似git push -f
强制推动它的命令?
参考:http: //guides.cocoapods.org/making/getting-setup-with-trunk
如果我只有像曼谷或东京这样的城市名称,我怎样才能[NSTimeZone timeZoneWithName:@"Asia/Tokyo"]
在城市前面的大陆和斜线上提供时区参数
?
我已经尝试过[NSTimeZone timeZoneWithName:@"Tokyo"]
,它不起作用.
我刚刚安装了Xcode5和iOS模拟器7.0 dvorak键盘布局无法正常工作.当我输入时,它显示为QWERTY布局.我尝试在我的mac中来回切换布局,但它没有帮助.
我构建应用程序时会出现警告,表明我的UISegmentedControlStyleBezeled已弃用.没有其他类型的UISegmentedControl看起来接近Bezeled一个,所以我不知道我可以使用什么而不是它.我需要像UISegmentedControlStyleBar这样的东西,但身高更高.
而且,查看UISegmentedControl.h揭示了这个......
typedef enum {
UISegmentedControlStylePlain, // large plain
UISegmentedControlStyleBordered, // large bordered
UISegmentedControlStyleBar, // small button/nav bar style. tintable
UISegmentedControlStyleBezeled, // DEPRECATED. Do not use this style.
} UISegmentedControlStyle;
Run Code Online (Sandbox Code Playgroud) 当我尝试调用时[CCTouchDispatcher sharedDispatcher];
,它显示缺少类方法sharedDispatcher的错误.我转到CCTouchDispatcher的.h文件,发现sharedDispatcher真的丢失了!我正在使用Cocos2D 2.0 beta2.它是从这个版本中删除的吗?如果是这样,我应该用什么来替换它.(可能是[[CCTouchDispatcher alloc] init]
)
我按照本教程https://code.google.com/p/ios-static-framework/创建了自己的iOS框架,该教程使用静态库模板和聚合目标以及自定义运行脚本来创建框架.
起初它工作正常.在框架项目中包含另一个库后,在存档或构建设备时会创建错误.我认为问题在于该库的一些错误设置.但我只是不知道该尝试什么.我试过从https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/ld.1.html设置一些明智的其他链接标志,但没有运气.任何人都可以帮忙;(
哪些步骤将重现该问题?
按照教程,但将聚合脚本架构从更改armv6 armv7
为armv7 armv7s
.这是我更改的聚合目标脚本的一部分.其他一切都是一样的.
if [[ "$SF_SDK_PLATFORM" = "iphoneos" ]]
then
SF_OTHER_PLATFORM=iphonesimulator
SF_ARCHS=i386
else
SF_OTHER_PLATFORM=iphoneos
SF_ARCHS="armv7 armv7s"
fi
Run Code Online (Sandbox Code Playgroud)将一个外部库添加到项目中,这里我使用libBlocksKit.a.
-ObjC
在应用程序中添加目标>构建设置>其他链接器标志错误是什么?
这个错误,基本上是"ld:warning:找不到选项的目录...... ld:lto:无法合并...符号乘法定义!".
ld: warning: directory not found for option '-L/Users/hlung/Dropbox/- Notes/stackoverflow/RealFrameworkApp/RealFrameworkApp/External/BlocksKit'
ld: lto: could not merge in /Users/hlung/Library/Developer/Xcode/DerivedData/RealFrameworkTest-evagqzwzyyolhjenkkjbvzibxppf/Build/Products/Debug-iphonesimulator/RealFrameworkTest.framework/RealFrameworkTest(NSObject+BlockObservation.o) because 'Linking globals named 'OBJC_CLASS_$_BKObserver': symbol multiply defined!', using libLTO version 'LLVM version 3.2svn, from Apple Clang 4.2 (build 425.0.28)' …
Run Code Online (Sandbox Code Playgroud) 运行git push heroku master
始终会触发提示:
使用npm安装依赖项
此步骤即使已经存在,也会再次加载并重新安装所有依赖项.这非常耗时,我希望在部署时有时会跳过此步骤,我知道依赖项是相同的.
是否有任何命令或选项可以做到这一点?
ios ×7
cocoapods ×2
frameworks ×1
heroku ×1
ios6 ×1
node.js ×1
npm ×1
nscoding ×1
nstimezone ×1
objective-c ×1
swift ×1
timezone ×1
xcode ×1
xcode5 ×1
xcode6 ×1