ios8

cursor out of control in textarea on IOS8 safari

╄→гoц情女王★ 提交于 2019-12-11 10:27:28
问题 cursor is not in textarea when user input long text or input some enter. This only happens on IOS8. see attachment. 回答1: find a wordaround to resolve the problem. textarea.addEventListener('scroll', function(evt){ evt = evt || window.evt; evt.target.setSelectionRange(evt.target.textLength - 1, evt.target.textLength - 1); setTimeout(function(){ evt.target.setSelectionRange(evt.target.textLength, evt.target.textLength); }, 0); }); 来源: https://stackoverflow.com/questions/31376906/cursor-out-of

how to parse different type of xml data or similar to xml structure

怎甘沉沦 提交于 2019-12-11 10:12:33
问题 I have scanned a image using my iphone and get the below type result. <?xml version="1.0" encoding="UTF-8"?> <PrintLetterBarcodeData uid="229636134720" name="Nandan Mohan Nilekani" gender="M" yob="1955" house="856, 13th Main , 3rd Block" loc="Koramangala" vtc="Bangalore South" po="Koramangala" dist="Bangalore" state="Karnataka" pc="560034"/> How can best way to split or parse the above xml data. 回答1: Please check this code - (void)viewDidLoad{ [super viewDidLoad]; NSString *DataPath = @"

AnyObject array returned by NSFetchRequest errors with “Swift dynamic cast failed” upon cast in Swift XCode 6 Beta 4 in XCTestCase

谁都会走 提交于 2019-12-11 10:08:18
问题 I know this has been asked before here but the answer did not solve my problem, and I wanted to post my full test case. I setup my Entities as in the screenshot: Entities setup image I had XCode generate a subclass of NSManagedObject: import Foundation import CoreData class Goal: NSManagedObject { @NSManaged var displayDesc: String @NSManaged var motivation: String @NSManaged var cratedDate: NSDate @NSManaged var goalType: NSNumber } It also created a header file called LifeList-Bridging

Today Extension and background audio

a 夏天 提交于 2019-12-11 09:58:54
问题 I am trying to do a simple podcast-like widget for iOS 8. Things works fine, audio works... except that when the screen sleep, the audio stops. Can Today Extension do background audio? Or multitasking in general? 回答1: No. Today Widget is destroyed when it goes out of view (as evidenced by viewDidDisappear).. so sound can only be enabled when the widget is physically in view. Edit: Nope it is linked to the host app that runs it. As detailed in Apple documentation, an extension is a specialized

Using iOS 8 flexible table cells, cell height changes but text doesn't wrap

╄→尐↘猪︶ㄣ 提交于 2019-12-11 09:52:06
问题 I'm trying to use the new method of creating flexible height cells in iOS 8 by instantiating with these two lines of code: tableView.estimatedRowHeight = 100.0 tableView.rowHeight = UITableViewAutomatic Dimension I've set autolayout constraints that all satisfied. When I put in the message "This is a test message." the table cell adjusts for the correct height for that short message. However when I try to add text that causes the text to wrap (in this case I just copied and pasted "This is a

iOS force App to use custom keyboard

我们两清 提交于 2019-12-11 09:47:05
问题 I am working on the app which has a one text-field which should accept only numbers so I created one custom keyboard which has only [0-9] as input to accept.To use this custom keyboard one has to go setting --> keyboards then accept this and then open particular keyboard from the app. Is this possible to force user to open only custom keyboard without going into setting option. I want whenever user opens the app.. only custom keyboard should open, not other 回答1: Just make it numeric by

Is 'performFetchWithCompletionHandler' called when no internet connection?

…衆ロ難τιáo~ 提交于 2019-12-11 09:45:44
问题 Will the UIApplicationDelegate call performFetchWithCompletionHandler if device is not connected to the internet ? The documentation isn't clear in this case. 回答1: After some tests I can claim that performFetchWithCompletionHandler delegate method is not called if device is not connected to the internet. Tested on iOS8 and iOS9. 回答2: -application:performFetchWithCompletionHandler: isn't called when a download has completed. It's called by the system to give your app a chance to download data.

Xcode 6.0 taking forever to archive my project

自古美人都是妖i 提交于 2019-12-11 09:45:39
问题 Xcode 6.0 taking about 8 hours to archive a fairly large project! Any idea how to make the archiving project faster? The archiving just gets stuck for hours at compiling 42 of 42 source files. Also, sometimes Xcode just crashing after hours of attempting to archive. I recently upgraded my Mac to a 2.3GHz quad-core Intel Core i7 processor and 16GB RAM, but unfortunately that didn't help. I want to understand if it is a PC configuration issue or an Xcode issue. In other words, if I upgrade to a

How can I continuously play background music while switching to different views using swift?

℡╲_俬逩灬. 提交于 2019-12-11 09:43:45
问题 I'm pretty new to swift and coding in general. I'm making a game now and I've added some background music and that's all working fine. I even figured out how to have the music play continuously when switching to different views, but every time I go back to the 'main menu' view in which I told the game to start playing the background music, It start over again. What I want it to do is to start playing when the user starts up the app and keeps looping till the user closes the app. I used this

IOS 8 AVAudioRecorder change sample fomat

∥☆過路亽.° 提交于 2019-12-11 09:32:18
问题 I'm building a app where one of the functions is to record a voice message I want sample format 16-bit PCM but i cant seem to get it right. I have tried lots of diffrent settings but everytime i check the file in audacity it says 32-bit float. This is my current recorderSettings var recorderSettings = [NSObject: AnyObject]() recorderSettings[AVFormatIDKey] = kAudioFormatALaw recorderSettings[AVSampleRateKey] = 16000 recorderSettings[AVNumberOfChannelsKey] = 1 recorderSettings