ios8

SWIFT: No idea how to get back the selected value from a popover to the calling controller

夙愿已清 提交于 2019-12-05 18:45:15
I just going crazy on Swift Popover “return” values. I am new to Objectiv-C as well as SWIFT but I try to focus on SWIFT. I checked out tutorials around Google and StackOverflow about how to manage iOS popovers, learned a lot but the last peace I couldn’t make it. It is great so see how easy it is made using Swift and Xcode 6, love it, but I could not figure out how to get back the selected value from my popover to my calling view controller. So here is my problem: (SIDENOTE: I am using SWIFT and do all using storyboard) I have created a master ViewController with a button to select currencies

Split Attributed String and Retain Formatting

倾然丶 夕夏残阳落幕 提交于 2019-12-05 18:44:39
How can you take an existing NSAttributedString and divide it based on a predefined separator while maintaining formatting? It does not seem that componentsSeparatedByString will operate on an NSAttributedString. My current workaround produces the splits at the correct points, but only outputs an NSString. Thus losing formatting. NSData *rtfFileData = [NSData dataWithContentsOfFile:path]; NSAttributedString *rtfFileAttributedString = [[NSAttributedString alloc] initWithData:rtfFileData options:@{NSDocumentTypeDocumentAttribute:NSRTFTextDocumentType} documentAttributes:nil error:nil]; NSString

“Error: this process has called an NSArray-taking method…” when iCloud pushes managed objects

无人久伴 提交于 2019-12-05 18:35:05
For every managed object that is sent via iCloud update, this warning/error is sent to the console: *** ERROR: this process has called an NSArray-taking method, such as initWithArray:, and passed in an NSSet object. This is being worked-around for now, but will soon cause you grief. My managed objects are Clients and have a one to many relationship with assessments as shown below. class Client: NSManagedObject { //other NSManaged vars are here @NSManaged var assessment: NSOrderedSet } Judging by the timing of this error (during ubiquitous updates) and the fact that this is my only use of NSSet

UISearchBar barTintColor clearColor error in iOS 8.0

ⅰ亾dé卋堺 提交于 2019-12-05 18:24:48
In my app i am using UISearchBar in xib with Xcode 6. And i have given bar tin color is clear color. It's working on iOS 7.1 below. But main problem is in iOS 8.0 it's not working clear color. It's displaying black color. See Image : Any one having adventurous of this issue. I had the same problem in search bar so i changed the Search style from default to Minimal . And it changed the bar style. You can add a 1x1 pixel transparence image as background image to UISearchBar. It would be a dirty workaround. I think Apple should fix this issue. You have to set UISearchBar tint color. UISearchBar

UIImagePickerController is not presenting correctly in iOS 8

大憨熊 提交于 2019-12-05 18:23:42
I'd like to present an UIImagePickerController with the following code: self.pickerController = [[UIImagePickerController alloc] init]; self.pickerController.sourceType = UIImagePickerControllerSourceTypePhotoLibrary; self.pickerController.delegate = self; [self presentViewController:self.pickerController animated:YES completion:nil]; It's working fine for iOS 7 and below, but in iOS 8 I got the following glitch: While transitioning to the image picker controller (vertical cover animation), the background colour of the picker controller is invisible, revealing the presenting view controller

iOS 8 custom keyboard extension UIKeyboardType

痞子三分冷 提交于 2019-12-05 18:17:39
I'm building a iOS 8 custom keyboard and I'd like the change the layout of the keyboard based on the UIKeyboardType, however, reading the keyboard type in UIInputViewController is always 0. Any suggestions? Thanks in advance! - (void)viewDidLoad { [super viewDidLoad]; NSLog(@"TextInputMode: %ld", self.textDocumentProxy.keyboardType); } Get the keyboardType in InputView Delegate Methods Instead of ViewDidLoad . Because you can't get the keyboardType until The keyboard is fully presented and the input object is activated . - (void)textWillChange:(id<UITextInput>)textInput { NSLog(@"TextInputMode

NSDocumentDirectory files disappear in ios

萝らか妹 提交于 2019-12-05 17:48:21
I want to save a mp4 video in my folder but when I open again the app, this file is nil. But when I save the file, I can open it, so it seems that it disappears from the folder. Save: NSData *videoData = [NSData dataWithContentsOfURL:exportUrl]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSString *tempPath = [documentsDirectory stringByAppendingFormat:@"/%@",videoName]; self.path_video_to_save = tempPath; BOOL success = [videoData writeToFile:tempPath atomically:YES]; if (success)

iOS 8 gray box over UITableView

亡梦爱人 提交于 2019-12-05 17:31:38
问题 I am making an app where I need to use UITableView s to display content in an organized fashion, but since I updated to iOS 8 and Xcode 6 I have been getting a mystery gray box over almost the entire view. This can be seen in the image below. This does not happen on every UITableView , just some (with no apparent pattern). 回答1: In iOS 8 , you must specify a height in the UITableView 's delegate: -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{

Show Icons for Custom UTIs in UIDocumentPickerViewController

心已入冬 提交于 2019-12-05 17:01:18
The iOS app I'm working on exports a UTI. The relevant parts of the Info.plist look like this: <key>UTExportedTypeDeclarations</key> <array> <dict> <key>UTTypeConformsTo</key> <array> <string>public.xml</string> <string>public.data</string> </array> <key>UTTypeDescription</key> <string>GPX Document</string> <key>UTTypeIdentifier</key> <string>de.company.app.gpx</string> <key>UTTypeSize320IconFile</key> <string>Doc320.png</string> <key>UTTypeSize64IconFile</key> <string>Doc64.png</string> <key>UTTypeTagSpecification</key> <dict> <key>public.filename-extension</key> <array> <string>gpx</string>

UIActivityViewController exclude all UIActivityCategoryAction

冷暖自知 提交于 2019-12-05 16:34:43
I have instantiated a UIActivityViewController . Conveniently, I can exclude individual activity types using the property excludedActivityTypes . I now want to exclude the activity category UIActivityCategoryAction . How can I exclude an activity category, as opposed to an individual activity type? As per current documentation, you can't but you could build an array holding all the individual types of an UIActivityCategory and pass it to the excludedActivityTypes property. If you fear that over time Apple could add new activity types and your UIActivityViewController will show the new types,