ios8

UILabel causes app to crash when added to view (Xcode 6 and iOS 8 only)

本小妞迷上赌 提交于 2019-12-08 19:18:04
问题 I have transitioned my project to Xcode 6 in order to build for iOS 8. However, a particular UILabel is causing the app to crash when it is added to the view hierarchy. This is the only error log I receive: -[MyViewController _contentInsetsFromFonts]: unrecognized selector sent to instance 0x16d90da0 I have been unable to locate the contentInsetsFromFonts method anywhere in my project. Additionally, I have not even been able to find a reference for it anywhere online, including Apple's

After iOS 8, can I continue to use UIActionSheet and UIAlertView?

 ̄綄美尐妖づ 提交于 2019-12-08 19:10:42
问题 I have apps which use UIActionSheet and UIAlertView . In iOS8, Apple's documentation and some websites say that they are deprecated in iOS8. UIActionSheet documentation Important: UIActionSheet is deprecated in iOS 8. (Note that UIActionSheetDelegate is also deprecated.) To create and manage action sheets in iOS 8 and later, instead use UIAlertController with a preferredStyle of UIAlertControllerStyleActionSheet. But in Xcode 6 with deployment target 8.0 does not generate warning for the use

create a UITableViewController programmatically in Swift

醉酒当歌 提交于 2019-12-08 18:55:42
问题 I'm trying to, as the title say, set up a UITableViewController programmatically. After a few hours of trying I hope someone can help me. And, yes, I hve checked out other posts on this matter: import UIKit class MainViewController: UITableViewController { init(style: UITableViewStyle) { super.init(style: style) // Custom initialization } override func viewDidLoad() { super.viewDidLoad() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() // Dispose of any resources

Keyboard intermittently disappears when editing using IOS 8

时间秒杀一切 提交于 2019-12-08 18:13:44
问题 I had several cases where testers reported that the keyboard would disappear whenever they started typing in some fields in my app. I traced the flow using the simulator and while debugging on a phone and the problem didn't occur, ever. However, when I tried it on an untethered phone it happened fairly consistently. Here's some pertinent code. All of this is to hide the keyboard when a user taps outside a textfield. My UIViews are subclasses of my Touchview class, which receives all touches:

Change ios8 Extension Navigation Bar color

不打扰是莪最后的温柔 提交于 2019-12-08 17:06:10
问题 I am working on iOS8 App Extension (Photo Editing Extension) I have tried these method to update the Navigation Bar color, but failed: [[UINavigationBar appearance] setBarTintColor:[UIColor yellowColor]]; [[UINavigationBar appearance] setTintColor:[UIColor blueColor]]; [[UINavigationBar appearance] setBackgroundColor:[UIColor blueColor]]; It displays a default translucent gray nav bar. Does anybody have idea on how to change the navigation bar color in iOS8 extension? 回答1: Try self

ptrace on iOS 8

扶醉桌前 提交于 2019-12-08 16:27:39
问题 I'm trying to call a function on ptrace like this ptrace(PT_DENY_ATTACH, 0, 0, 0); But when I try to import it using #include <sys/ptrace.h> Xcode gives me an error 'sys/ptrace.h' file not found . Am I missing something, do I need to import a library or is this simply unavailable on iOS? 回答1: The problem here is that Xcode is prepending its SDK base path to all system header paths (e.g., /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS9.0.sdk/usr

iOS8 issue when trying to push multiple UIViewControllers in NavigationController

限于喜欢 提交于 2019-12-08 15:23:28
I have 6 UIViewControllers connected with push segues with identifiers and a functionality in my app to 'jump' to the desired UIViewController using this method for stacking ViewControllers: - (void) JumpTo6 { UINavigationController *nav = self.navigationController; UIViewController *a =[self.storyboard instantiateViewControllerWithIdentifier:@"2"]; [nav pushViewController:a animated:NO]; UIViewController *b =[self.storyboard instantiateViewControllerWithIdentifier:@"3"]; [nav pushViewController:b animated:NO]; UIViewController *c =[self.storyboard instantiateViewControllerWithIdentifier:@"4"]

Xcode 6 Instruments freeze

送分小仙女□ 提交于 2019-12-08 14:52:10
问题 Profiling my iOS 8 app in Xcode 6 Instruments will run the app for about 5 seconds and then freeze. The profiler will still run after that point but the app is frozen and unusable. Happens on device and simulator and regardless of which profiler I'm using (timer, leaks, etc.) Running the app from the debugger or an ad hoc build works fine. Profiling with iOS 7 works fine as well. Any idea why this may be happening? Is Instruments broken? 回答1: Same issue here: Application hangs when profiling

Xcode 6 Beta iOS 8 Simulator can't access internet

╄→гoц情女王★ 提交于 2019-12-08 14:32:11
问题 Just installed XCode 6 Beta to test my app. The iOS 8 Simulator runs and my app successfully installs but the simulator can't access the internet. I try using safari or maps and there is no network connection. If I run the iOS 7 simulator from XCode 6, it connects to the internet perfectly. I've tried using the steps in this thread but it didn't change anything. (The steps were more if your app doesn't install but I tried anyway.) I don't have a firewall or little snitch blocking the

Posting JSON data to server

一曲冷凌霜 提交于 2019-12-08 13:57:47
I am trying to post and JSON data to server. My JSON is: { “username”:”sample”, “password” : “password-1” } The way I am sending it to server is: NSError *error; NSString *data = [NSString stringWithFormat:@"{\"username\":\"%@\",\"password\":\"%@\"}",_textFieldUserName.text,_textFieldPasssword.text]; NSData *postData = [data dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSData *jsonData = [NSJSONSerialization JSONObjectWithData:postData options:0 error:&error]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL:[NSURL URLWithString:@"My URL"