ios7

what to use instead of scrollRangeToVisible in iOS7 or TextKit

橙三吉。 提交于 2020-01-11 04:49:14
问题 In previous versions of iOS, my UITextView will scroll to the bottom using [displayText scrollRangeToVisible:NSMakeRange(0,[displayText.text length])]; or CGFloat topCorrect = displayText.contentSize.height -[displayText bounds].size.height; topCorrect = (topCorrect<0.0?0.0:topCorrect); displayText.contentOffset = (CGPoint){.x=0, .y=topCorrect}; But the former will now have the weird effect of starting at the top of a long length of text and animating the scroll to the bottom each time I

iOS 7 background upload and POST requests

大城市里の小女人 提交于 2020-01-11 03:45:07
问题 I need to upload files in the background with other HTTP POST requests before and after each upload. Previously I was using beginBackgroundTaskWithExpirationHandler which was working perfectly till iOS 6 but from IOS 7 it is restricted for approx 180 seconds only which is a concern. I have read the documents regarding NSURLSession were in we have Background transfer service. But the problem with this is it only allows upload and download in background. It doesn't allow me to make POST request

Have particle emitter trail follow finger path in spriteKit

二次信任 提交于 2020-01-11 02:36:09
问题 I have created a particle emitter in Xcode that has quite a lengthy trail. When i move it inside of the particle generator it leaves a trail following my mouse path. some background info on my goal: In my spriteKit game the user drags their finger around the screen to shoot moving objects. I am attempting to create a "Bullet Time" effect where the objects slow down and highlights when the current finger location touches them. When the finger stops moving or they run out of ammo the

iOS 7 beginUpdates endUpdates inconsistent

情到浓时终转凉″ 提交于 2020-01-11 02:03:26
问题 Edit : The solution for this answer is related to iOS7 sometimes returning NSIndexPath and other times returning NSMutableIndexPath . The issue wasn't really related to begin/endUpdates , but hopefully the solution will help some others. All - I'm running my app on iOS 7, and I'm running into problems with the beginUpdates and endUpdates methods for a UITableView . I have a tableview that needs to change the height of a cell when touched. Below is my code: - (CGFloat)tableView:(UITableView *

iOS 7.1 beta5 tableviewcell height showing objects outside it's range

陌路散爱 提交于 2020-01-10 19:34:11
问题 I have an app that has a list of UITableViewCells. By default, the cells are set to a certain height (lets say 100) to show only some basic information. When the user clicks on a cell the height changes to 150 to show more actions that were previously not seen. This works without a problem on iOS 7.0.0-7.0.5. I'm testing on an iPhone 5s running iOS 7.1 beta 5 and seeing some drawing issues with the cells. Here's how it looks on iOS 7.0... versions which is what is expected. When the cell is

ABAddressBookCreate deprecated

一笑奈何 提交于 2020-01-10 08:29:07
问题 I'm creating an application that will save a contact to the address book, but when I use ABAddressBookCreate to my code, it appear as a warning. I'm coding in iOS 7. My question is, what is the substitute for ABAddressBookCreate in iOS 7. Any help will be appreciated. Thanks. 回答1: Use ABAddressBookCreateWithOptions() instead. ABAddressBookRef addressBook = ABAddressBookCreateWithOptions(NULL, NULL); More info on usage in the documentation here edit The AddressBook framework is deprecated in

How to set current playback duration and elapsed time on iOS 7 lockscreen?

為{幸葍}努か 提交于 2020-01-09 09:03:13
问题 Starting from iOS 5, every music player can set current playing music information such as title, artist, album title, and artwork on [MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo to show on lock screen. On iOS 7, playback position slider, duration, and elapsed time information are added to both lock screen and control center. However, I cannot find any documents to set these kinds of information and enable the slider to change playback position. Is there any way to solve this problem?

How to set current playback duration and elapsed time on iOS 7 lockscreen?

半腔热情 提交于 2020-01-09 09:03:12
问题 Starting from iOS 5, every music player can set current playing music information such as title, artist, album title, and artwork on [MPNowPlayingInfoCenter defaultCenter].nowPlayingInfo to show on lock screen. On iOS 7, playback position slider, duration, and elapsed time information are added to both lock screen and control center. However, I cannot find any documents to set these kinds of information and enable the slider to change playback position. Is there any way to solve this problem?

UITableViewCell delete button gets covered up

自作多情 提交于 2020-01-09 03:20:51
问题 UPDATE: Thanks to information from "Evgeny S" I've been able to determine that what is covering up the delete button is the cell background. I had the following function called at the beginning of cell init: - (void) setupGradientsWithHeight:(int) the_height { CAGradientLayer* gradient = [CAGradientLayer layer]; gradient.frame = CGRectMake(self.bounds.origin.x, self.bounds.origin.y, self.bounds.size.width, the_height); gradient.colors = [NSArray arrayWithObjects: (id)[UIColor colorWithRed:218

How to compare two given times with current time? [duplicate]

爱⌒轻易说出口 提交于 2020-01-07 09:31:49
问题 This question already has an answer here : Compare current time with two times-of-day strings [closed] (1 answer) Closed 5 years ago . I want to compare current time with two different times on different dates.MY code is NSString *time1 = record.trigger_from_time; NSString *time2 = record.trigger_to_time; NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"HH:mm:ss"]; NSDate *date1= [formatter dateFromString:time1]; NSDate *date2 = [formatter dateFromString