使用Autolay的animation/移动视图

我想从一个位置移动到另一个位置,我可以使用它来实现它 self.view.center = CGPointMake(100, 200); 但是,如果项目使用Autolayout,那么运行后视图将回到原始位置: [self.view.superview setNeedsLayout]; 那么如何将视图移到新的位置?

WatchKit SDK不从NSUserDefaults中检索数据

我想为苹果手表制作一个testing应用程序,您可以在手机上设置一些string,然后显示在Apple Watch上。 我决定使用NSUserDefaults类来存储这些数据。 在我的视图控制器为iPhone我有一个方法,把input和存储到本地存储: – (IBAction)saveInfo:(id)sender { NSString *userInput = [myTextField text]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults setObject:userInput forKey:@"savedUserInput"]; [defaults synchronize]; self.myLabel.text = [defaults stringForKey:@"savedUserInput"]; } 在我的手表界面控制器中,我有一个方法来检索数据并显示它: – (IBAction)showText2 { NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; [defaults synchronize]; self.myLabel2.text = [defaults stringForKey:@"savedUserInput"]; } 除了某些原因,我试图检索的数据显示为空,并且标签没有被更新。

想要创build一个很酷的静态UI,但是:“静态表视图只是有效的…”

所以我创build一个视图如: 为此,我试图使用一个故事板,我添加了两个TableViews(都作为“静态单元格”),然后我手动添加我的单元格内容直接从故事板… 在我的故事板,它看起来不错,但是当我build立我得到: en.lproj / MainStoryboard.storyboard:错误:非法configuration:静态表视图只有在UITableViewController实例中embedded时才有效 如果你们对这个问题有什么想法的话。 谢谢 !

CFBundleVersion必须高于以前的版本

我正在提交更新到我的一个应用程序。 我已经用我开发的许多不同的应用程序做了几十次,但是这个失败了一些奇怪的原因。 我将我的应用程序归档,然后尝试validation归档并获取以下错误消息: This bundle is invalid. The key CFBundleVersion in the Info.plist file must contain a higher version than that of the previously uploaded version. iTunesConnect显示这个应用程序目前在1.0,我已经configuration它准备上传1.1版(截图与应用程序图标编辑): 下面是我的应用程序目标的摘要信息的屏幕截图,显示版本和简短版本都是“1.1”: 这里是Bundle Archive中Info.plist的上半部分: <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>AppStoreFileSize</key> <integer>20859080</integer> <key>ApplicationProperties</key> <dict> <key>ApplicationPath</key> <string>Applications/MyApp.app</string> <key>CFBundleIdentifier</key> <string>com.mydomain.myapp</string> <key>CFBundleShortVersionString</key> <string>1.1</string> 以下是归档包中的应用程序中Info.plist的相关部分: <key>CFBundleShortVersionString</key> […]

错误:ld:库找不到-lPods与CocoaPods

在我用Cocoapods安装了DTCoreText( https://github.com/Cocoanetics/DTCoreText )之后,当我尝试运行模拟器或设备时,总是出现错误! ld: warning: directory not found for option '-L/Users/example/Desktop/ios/Pods/build/Release-iphoneos' ld: warning: directory not found for option '-L/Users/example/Desktop/ios/Pods/build/Debug-iphoneos' ld: library not found for -lPods-example clang: error: linker command failed with exit code 1 (use -v to see invocation) 在我的“与库链接二进制文件”的“libPods”部分是红色的: 这里是我的build立设置: 我的项目的设置: 我的豆荚的设置: 编辑: 我不完全确定是什么问题,但我解决了它,当我删除所有的DTCoreText和Cocoapods的东西,再次重新安装的一切!

在Swift(2.0)中正确处理NSJSONSerialization(try catch)?

arowmy init在Swift 2中工作正常,但是在Swift 2中,我从Xcode Call can throw, but it is not marked with 'try' and the error is not handled得到一个错误消息, Call can throw, but it is not marked with 'try' and the error is not handled在Call can throw, but it is not marked with 'try' and the error is not handled的let anyObj = NSJSONSerialization.JSONObjectWithData(data, options: […]

UITableViewCellDeleteConfirmationControl问题

我在项目中使用以下代码: if([NSStringFromClass([subview class]) isEqualToString:@"UITableViewCellDeleteConfirmationControl"]) 这在iOS 5和6上工作正常。但是在iOS 7上它总是返回NO。 任何人都可以告诉我这是iOS 7的问题,或者我做错了什么? 谢谢!

快速实现HMAC和SHA1encryption

我相对较新的Swift,我卡住encryption使用HMAC和SHA1。 我发现以下回答https://stackoverflow.com/a/24411522/4188344,但我不能解决如何正确实施。 任何帮助将是惊人的。

如何知道推送通知传送状态

我在应用程序中使用推送通知。 一切都很好。 有时从服务器发送消息,但在应用程序方面,它没有收到。 在这种情况下,我必须知道哪些邮件丢失交付(应用程序没有收到)。 有什么办法从服务器端知道哪些消息是由应用程序接收,哪些不是?

IOS越狱如何拦截短信/短信

我目前正在尝试编写拦截短信的应用程序,并根据该消息的内容作出反应。 我试图挂钩到_receivedMessage:(struct __CKSMSRecord *)message replace:(BOOL)replace CKSMSService类中的_receivedMessage:(struct __CKSMSRecord *)message replace:(BOOL)replace方法,但这似乎并没有被调用。 有人能告诉我什么function/类我必须挂钩? 我需要拦截文本消息,然后显示并存储到数据库中。 我在IOS 5.0.1上。 任何帮助是真正的赞赏。