ios8

UIViewController presentViewController crashing on ios 8

折月煮酒 提交于 2019-12-24 03:42:58
问题 Just got this error in our error logging system, been searching hi and low and can't seem to find any solution. Any help is appreciated. Here is the stacktrace. 回答1: May be in your XCODE log you might have encountered this message "Presenting view controllers on detached view controllers is discouraged ". If yes then then try [self.view.window.rootViewController presentViewController:myVC]; if this fails then make sure you call presentViewController:myVC on immediate presenting ViewController

In iOS 8 Beacon not detecting

无人久伴 提交于 2019-12-24 03:19:30
问题 iBeacon suddenly stopped working in iOS8. Before it was working fine in previous iOS 8 versions. Anybody help me to come out from this problem? What is the problem, Thanks 回答1: What you need to do is to add request permission for accessing location services in the code, like the following: if([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) { [self.locationManager requestAlwaysAuthorization]; } Also, in your app info.plist(AppName-info.plist), add the key

In iOS 8 Beacon not detecting

妖精的绣舞 提交于 2019-12-24 03:18:28
问题 iBeacon suddenly stopped working in iOS8. Before it was working fine in previous iOS 8 versions. Anybody help me to come out from this problem? What is the problem, Thanks 回答1: What you need to do is to add request permission for accessing location services in the code, like the following: if([self.locationManager respondsToSelector:@selector(requestAlwaysAuthorization)]) { [self.locationManager requestAlwaysAuthorization]; } Also, in your app info.plist(AppName-info.plist), add the key

Why does my UITableView report itself as 600x600, or what it is in the Storyboard, when I have constraints set?

瘦欲@ 提交于 2019-12-24 03:18:24
问题 My UITableView , when I po the frame in the debugger, reports its width and height as 600x600. I have it pinned to the sides of its view controller, so I don't understand why it would be reporting this. The 600x600 is its dimensions within the Any x Any Storyboard grid, but like I said, it should be updating. Is this a glitch? 回答1: It will report 600x600 dimensions until its layout is complete. If you override viewDidLayoutSubviews method and put a breakpoint there: - (void)

Google App Indexing not resolving for Swift?

*爱你&永不变心* 提交于 2019-12-24 03:16:59
问题 I'm trying to integrate Google App Indexing into my iOS / Swift app. I installed it via CocoaPods. The problem is it's not resolving any of Google's code. Here's what I got: func application(application: UIApplication, openURL url: NSURL, sourceApplication: String?, annotation: AnyObject?) -> Bool { var sanitizedURL = GSDDeepLink.handleDeepLink(url) return true } The compile error says: Use of unresolved identifier 'GSDDeepLink' . I tried adding import GoogleAppIndexing and even import

UIViewAlertForUnsatisfiableConstraints when presenting popover controller on iOS8 iPad

强颜欢笑 提交于 2019-12-24 03:16:47
问题 UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"What would you like to do?" message:@"" preferredStyle:UIAlertControllerStyleActionSheet]; [alert addAction:...] //left out for brevity of post UIPopoverPresentationController *pop = [alert popoverPresentationController]; pop.sourceView = self.view; pop.sourceRect = self.view.frame; pop.permittedArrowDirections = UIPopoverArrowDirectionAny; [self presentViewController:alert animated:true completion:^{ }]; The methods in

How to add values in swift dictionary dynamically

北战南征 提交于 2019-12-24 02:43:16
问题 I have declared a dictionary in my swift class as below : var profileDetail = Dictionary<String, String>() But I'm not able to add values in it. IF I try like following, It only stores the last value. profileDetail = [profileItem[1]:values.valueForKey("middle_name") as String] profileDetail = [profileItem[2]:values.valueForKey("last_name") as String] profileDetail = [profileItem[3]:values.valueForKey("gender") as String] profileDetail = [profileItem[4]:values.valueForKey("birth_date") as

UISplitViewController Rotation Master Master on iPhone 6 Plus

浪子不回头ぞ 提交于 2019-12-24 02:36:04
问题 So if you create a UISplitViewController with 'MasterView' and 'DetailView' setup like this in the 'MasterView' in portrait on the iPhone 6 Plus you push/show 'MasterView2' by pressing the item button and then you rotate the device I would expect to see this - 'MasterView2' | 'DetailView' but instead I get 'MasterView' | 'MasterView2' How should this be setup so on rotating the iPhone 6 Plus I get the expected 'MasterView2' | 'DetailView'? 回答1: for anyone interested here is how I solved the

Custom fonts in iOS 8 not showing

◇◆丶佛笑我妖孽 提交于 2019-12-24 02:35:05
问题 When building for iOS 7, my custom fonts are displayed in a UILabel correctly. However building with XCode 6 and for iOS 8 another "standard" font is displayed. Code: UILabel *label = [[UILabel alloc] initWithFrame:rect]; UIFont *font = [[CAPTheme sharedTheme] appTitleFont]; label.text = title; label.textAlignment = NSTextAlignmentCenter; label.textColor = [UIColor whiteColor]; label.backgroundColor = [UIColor clearColor]; label.alpha = kLabelAlphaConstant; [label setFont:font]; ... - (UIFont

Swift: strange behavior about unwrapping

ぃ、小莉子 提交于 2019-12-24 01:54:44
问题 In my Child model, I have declared the following properties: var name:String? var year:String? var make:String? var model:String? and the init: init(name:String, ... ,year:String, make:String, model:String, ...){ self.name = name ... self.year = year self.make = make self.model = model } Here I construct a child: Child(name:cName,...,year:cYear,make:cMake, model:cModel,...) In func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell!{ For the