ios8

iOS8 NSXMLParser crash

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-10 10:44:04
问题 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

iOS 8 / Xcode 6 Simulator is not using HTTP Proxy anymore

久未见 提交于 2020-01-10 08:47:05
问题 My iOS 8 Simulator is not using my proxy settings anymore (I want to debug with Charles). The rest of the system does. The simulator somehow seems to get direct internet access. Have I missed some new setting? Caution: this is NO dup of How to use Charles Proxy on the Xcode 6 (iOS 8) Simulator?. I´m not trying to use SSL on the simulator in the first place. My simulator doesn´t even start to use the proxy. Charles: System: 回答1: Restart the simulator between proxy changes 回答2: This is correct.

Change UISearchBar cancel button text in iOS 8

末鹿安然 提交于 2020-01-10 06:59:05
问题 I'd like to change the text from ¨Cancel¨to ¨Done¨ of the Cancel button inside the UISearchBar in iOS 8. I am using UISearchController. I've tried different approaches for iOS 6 and iOS 7 and they do not work. Has anybody done this? 回答1: Objective-C: [searchBar setValue:@"customString" forKey:@"_cancelButtonText"]; Swift: searchBar.setValue("customString", forKey:"_cancelButtonText") 回答2: This worked for me in ios8, did not try in ios7, but should do the trick, beware of placing this line in

Injecting a new stylesheet into a website via uiwebview using iOS8 Swift XCode 6

﹥>﹥吖頭↗ 提交于 2020-01-10 05:27:06
问题 I've seen a few options on here using just Objective-C, but I'm having trouble doing this with Swift iOS8 in XCode 6. I'm using the uiwebview to load a website. For sake of example, let's say its google.com. @IBOutlet var website: UIWebView! var url = "http://www.google.com" func loadUrl() { let requestURL = NSURL(string: url) let request = NSURLRequest(URL: requestURL!) website.loadRequest(request) } override func viewDidLoad() { super.viewDidLoad() website.delegate = self loadUrl() } func

Custom UITableViewCell register class in Swift

孤街浪徒 提交于 2020-01-10 01:02:50
问题 In my application, I fill the table on the basis of the array. The table uses custom UITableViewCell. Everything works fine, table is filled. Then I add Search Display Controller to my UITableViewController, no write code to handle the search, simply add the controller. When you run the application, the table is still filled.But if I try to click on the search bar, I get the error: Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'unable to dequeue a cell

CVPixelBufferPool Error ( kCVReturnInvalidArgument/-6661)

帅比萌擦擦* 提交于 2020-01-09 10:43:46
问题 I've implemented previous suggestions with Swift (How to use CVPixelBufferPool in conjunction with AVAssetWriterInputPixelBufferAdaptor in iPhone?), but got stuck with an "kCVReturnInvalidArgument" (error value: -6661) when using CVPixelBufferPoolCreatePixelBuffer as guided. I'm basically trying to create a movie from images, but as the buffer pool isn't created successfully, I can't append pixel buffers--here is my code for doing this. Any suggestions are highly appreciated! import

Check if Local Notifications are enabled in IOS 8

心不动则不痛 提交于 2020-01-09 04:18:08
问题 I've looked all over the internet for how to create local notifications with IOS 8. I found many articles, but none explained how to determine if the user has set "alerts" on or off. Could someone please help me!!! I would prefer to use Objective C over Swift. 回答1: You can check it by using UIApplication 's currentUserNotificationSettings if ([[UIApplication sharedApplication] respondsToSelector:@selector(currentUserNotificationSettings)]){ // Check it's iOS 8 and above

UIMoviePlayerControllerDidEnterFullscreenNotification doesn't work in iOS8

橙三吉。 提交于 2020-01-09 03:21:53
问题 I am using UIWebView to play a youtube video with iFrame. I am using UIMoviePlayerControllerDidEnterFullscreenNotification to detect youtube screen into fullscreen. Like below code : [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(myMovieEnterFullScreen:) name: @"UIMoviePlayerControllerDidEnterFullscreenNotification" object: nil]; It works in iOS7. But I try to run it in iOS8. It doesn't work. I think the notification name has be changed. Has any alternative to

Order of sections produced by NSFetchedResultsController?

≯℡__Kan透↙ 提交于 2020-01-07 07:16:24
问题 Does a NSFetchedResultsController assign values for the attribute identified by sectionNameKeyPath to sections always in ascending order? For instance if my sectionNameKeyPath were an (optional) boolean attribute with values @(YES) , @(NO) , @(YES) , would the first section receive one row (because NO corresponds to 0 ) and the second section receive two (because YES corresponds to 1 )? So is that the case and if that is, can one change the order (without introducing another attribute that

[UIImageAsset retain]: message sent to deallocated instance

好久不见. 提交于 2020-01-07 06:47:19
问题 A line UIImage *tempImage = [UIImage imageNamed:@"gradient-image"]; gets executed inside an NSOperation, on the background thread. The code breaks here with the message: [UIImageAsset retain]: message sent to deallocated instance I have the image by the name gradient-image in Images.xcassets . Honestly, I don't even know what other info would be relevant. This happens on rare occasions, I cannot reproduce it consistently. I've googled a bit, but not much results. So, I decided to create a