ios8

iOS 8.0 bluetooth peripheral manager giving no callback for addService

耗尽温柔 提交于 2020-01-11 09:51:14
问题 I have created a bluetooth peripheral manager. I am adding some services to this peripheral manager using [self.peripheralManager addService:myService]. For iOS7.0 I am getting a callback for this method - (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(NSError *)error But for iOS8.0 I am not getting any callback for the same method and I am not able to establish a connection. Here are the steps that I followed: Create a peripheral manager

iOS 8.0 bluetooth peripheral manager giving no callback for addService

倾然丶 夕夏残阳落幕 提交于 2020-01-11 09:51:11
问题 I have created a bluetooth peripheral manager. I am adding some services to this peripheral manager using [self.peripheralManager addService:myService]. For iOS7.0 I am getting a callback for this method - (void)peripheralManager:(CBPeripheralManager *)peripheral didAddService:(CBService *)service error:(NSError *)error But for iOS8.0 I am not getting any callback for the same method and I am not able to establish a connection. Here are the steps that I followed: Create a peripheral manager

Leaving inputAccessoryView visible after keyboard is dismissed iOS8?

天涯浪子 提交于 2020-01-11 09:25:12
问题 I want to make behavior like messaging app. I have been browsing Stack Overflow for solutions for this, and indeed there are plenty: Leaving inputAccessoryView visible after keyboard is dismissed This was the one that I found. But it seems things are a little different in iOS8 . If I do the same thing in new iOS8 sdk , i get error: 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x7fdcb3441b10> should have parent view controller:

Leaving inputAccessoryView visible after keyboard is dismissed iOS8?

纵然是瞬间 提交于 2020-01-11 09:25:02
问题 I want to make behavior like messaging app. I have been browsing Stack Overflow for solutions for this, and indeed there are plenty: Leaving inputAccessoryView visible after keyboard is dismissed This was the one that I found. But it seems things are a little different in iOS8 . If I do the same thing in new iOS8 sdk , i get error: 'UIViewControllerHierarchyInconsistency', reason: 'child view controller:<UICompatibilityInputViewController: 0x7fdcb3441b10> should have parent view controller:

Distinguish iPad orientation with size classes

北战南征 提交于 2020-01-11 09:17:17
问题 With iOS 8 Apple introduced size classes for handling layouts of an app. Instead of designing user interfaces dependent on device, screen size, and orientation, developers are encouraged to rather adapt their app's layout depending on the active size classes. That's a good move, I think. However, when it comes to the iPad there seem to be no way to distinguish the different device orientations (which provide quite different screen space and handling in my opinion). From the Human Interface

iOS alertview for location permission doesn't pop up

故事扮演 提交于 2020-01-11 08:25:08
问题 I just started my project for iOS 8 and i ran in too the problem that i cant get the question to pop up for permission. I added the following to my info.plist <key>NSLocationWhenInUseUsageDescription</key> <string>The spirit of stack overflow is coders helping coders</string> <key>NSLocationAlwaysUsageDescription</key> <string>I have learned more on stack overflow than anything else</string> and this is my code : @interface ViewController () <MKMapViewDelegate> @property (nonatomic, strong)

How do I intercept tapping of the done button in AVPlayerViewController?

你说的曾经没有我的故事 提交于 2020-01-10 21:45:05
问题 I created an AVPlayerViewController and an attached AVPlayer in the viewDidAppear method of a custom UIViewController . However, when I press the "Done" button my custom view controller is dismissed automatically. I would like to intercept this action in order to use my own unwind Segue, but I'm not sure how to do this. I've found examples for MPMoviePlayerViewController but not AVPlayerViewController . The code I found for MPMoviePlayerViewController is below: - (void)playVideo:(NSString *

How do I intercept tapping of the done button in AVPlayerViewController?

北慕城南 提交于 2020-01-10 21:44:47
问题 I created an AVPlayerViewController and an attached AVPlayer in the viewDidAppear method of a custom UIViewController . However, when I press the "Done" button my custom view controller is dismissed automatically. I would like to intercept this action in order to use my own unwind Segue, but I'm not sure how to do this. I've found examples for MPMoviePlayerViewController but not AVPlayerViewController . The code I found for MPMoviePlayerViewController is below: - (void)playVideo:(NSString *

Open HealthKit App from another app

依然范特西╮ 提交于 2020-01-10 18:22:10
问题 I want to build a fitness app that will upload the data to HealthKit. Is there any way to open/navigate to HealthKit from another app? 回答1: On iOS 10, the Health app URL scheme is x-apple-health . You can open it from within your own app by calling: Objective-C: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"x-apple-health://"]]; Swift: UIApplication.shared.open(URL(string: "x-apple-health://")!) See Open Health app using url scheme | Apple Developer Forums. 回答2: iOS does

iOS8 NSXMLParser crash

心不动则不痛 提交于 2020-01-10 10:44:08
问题 I had a crash in NSXMLParser * Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSXMLParser does not support reentrant parsing.' Here is my code NSString *wrappedSnippet = [NSString stringWithFormat:@"<html>%@</html>", self.snippet]; NSXMLParser *parser = [[NSXMLParser alloc] initWithData:[wrappedSnippet dataUsingEncoding:NSUTF8StringEncoding]]; [parser setDelegate:self]; [parser parse]; app crashes on the last line. Note, that everything works perfect on