ios7

How to detect if a iphone is connected to any bluetooth device or not?

拥有回忆 提交于 2019-12-11 02:44:50
问题 I came across this new API from iOS 7. - (NSArray *)retrieveConnectedPeripheralsWithServices:(NSArray *)serviceUUIDs NS_AVAILABLE(NA, 7_0); So its pretty clear that if the return array count is greater than 0 than its connected to atleast one device. But before using this API I am not able to figure it out the argument (serviceUUIDs) that I have to passed here. Can someone explain here with an example? 回答1: You can't use this method unless you know at least one service exposed by the device.

Can't save CIImage to file on iOS without memory leaks

梦想的初衷 提交于 2019-12-11 02:38:33
问题 The following snippet of code save a CIImage to disk using an UIImage . - (void)applicationWillResignActive:(UIApplication *)application { NSString* filename = @"Test.png"; UIImage *image = [UIImage imageNamed:filename]; // make some image processing then store the output CIImage *processedImage = [CIImage imageWithCGImage:image.CGImage]; #if 1// save using context CIContext *context = [CIContext contextWithOptions:nil]; CGImageRef cgiimage = [context createCGImage:processedImage fromRect

Xcode 5 not displaying Top/Bottom Layout Guides for TableViewControllers

若如初见. 提交于 2019-12-11 02:38:03
问题 The Interface Builder in Xcode 5.1.1 displays Top Layout Guide and Bottom Layout Guides for View Controllers but apparently not for Table View Controllers . Is this indeed (always) the case and what is the reason why? 回答1: Because the layout guides are irrelevant in table view controllers. If you need to add other views to a table view controller, you shouldn't be using a table view controller, but a regular view controller with a UITableView and any other views you'd like. 来源: https:/

Is it possible to attach a file to an ios calender event?

谁都会走 提交于 2019-12-11 02:36:57
问题 In Mac OS it is possible to attach files to a calender event and read that files on the iOS calender. Question: Is it possible to attach a file to an iOS calender event using the Event Kit framework? I could not find any hint in the Event Kit documentation 回答1: The short answer to your question is no - there is no way to attach a file to an iOS Calendar Event. Why? Because there is no place to put a file. Looking at the EKEvent Class Reference turns up a short list of properties, none of

Why is my text view full of unwanted space? Extra lines not in code. Screenshots

喜夏-厌秋 提交于 2019-12-11 02:34:03
问题 I have a programatically populated storyboard text view. [textView setFont:[UIFont boldSystemFontOfSize:11.0f]]; textView.text = @"Why oh why is this happening to me?! This seems like a pretty absurd problem to be having."; This is how the text box loads. The text box is created between the image you see at the top and the two images you see at the bottom and it fills the whole space in-between. How the text box looks if I scroll up (and how I want it to appear). It seems like there are a

PushNotifications iOS 7 not working when user taps on icon

你说的曾经没有我的故事 提交于 2019-12-11 02:27:11
问题 I have the methods below to handle push notifications. They work perfect when the app is running and I do receive notifications when the app is in the background. When a user taps the icon however it opens the app but my UICollection view is not reloaded the way it is when a user receives the notification when the app is running. -(void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo { UIApplicationState state = [application applicationState]; if

How can one app provide data to another without swiching apps?

三世轮回 提交于 2019-12-11 02:14:58
问题 Scenario: I "control" two different apps, App A and App B, both which the user has installed App A is running App A needs to obtain a string that was set by App B when App B last ran. After obtaining the string, App A will still be running User should not receive any feedback this communication is happening. E.g. no "switching animations" between A or B, no pop-ups, etc. Constraints: Apps are released under different vendors Apps are already in the app store; updated versions will have this

Using a bluetooth sound device in iOS7 without microphone permissions

不想你离开。 提交于 2019-12-11 02:08:51
问题 With the iOS7 the AudioSession Category AVAudioSessionCategoryPlayAndRecord asks for Microphone permission. However, that permission doesn't feel right if I only need to support bluetooth for external audio. There are some people that are in the same situation as I am right now, but I can't find an answer for this. In iOS6 I was using this code to route the sound to bluetooth devices: [[AVAudioSession sharedInstance] setDelegate:self]; [[AVAudioSession sharedInstance] setCategory

Drawing a polygon in MKMapView IOS 7 is not correct

喜夏-厌秋 提交于 2019-12-11 02:08:40
问题 In MKMapView , I created a polygon using these points: 1- lat = 0.0; long = -170; 2- lat = 0.0; long = 170; 3- lat = 10; long = 180; The first two points are only 20 degrees apart, but the MKMapView draws it in the other direction around the world (which is 170 + 170 = 340 degrees apart). Is there any fix to that? 回答1: I'm surprised you're having issues with this in iOS 7, as they handle spanning the meridian better than prior versions. In iOS 7, the following: CLLocationCoordinate2D

Twitter account created with tokens fails on iOS7

南笙酒味 提交于 2019-12-11 02:04:52
问题 I am working on an app running on iOS6/7, with custom views to post on Twitter. To improve user experience, if no system accounts are available, I would present the user with a webview to enter their credentials , store them in the ACAccountStore as suggested in ACAccountCredential.h and use it to post. It works great on iOS6 but on iOS7 sharing fails with 401 error . The weird thing is that the account is saved with no errors in the ACAccountStore and can be used by the Twitter app to read