cocoa-touch

MPMoviePlayer playing audio but not video when seeking into a file

大憨熊 提交于 2020-01-04 01:39:20
问题 I'm trying to seek into a video file at a certain point. Lets say the video is 5 minutes long and I'm jumping in at 110 seconds. When I play from the beginning, everything plays through fine, however, when I try to seek into the file, I can hear the audio but I can't see the video. I first thought this was maybe an issue with the order I'm loading the subviews but I can still see (and use) the controls for the player. Sliding back to 0:00 starts the video. The following is code from my video

Problem using NSRange: Index out of bounds

爷,独闯天下 提交于 2020-01-03 19:33:22
问题 I am trying to detect website URL's in my string and then doing some attribution string stuff like bolding it etc. My regex is defined as: static NSRegularExpression *websiteRegularExpression; static inline NSRegularExpression * WebsiteRegularExpression() { if (!websiteRegularExpression) { websiteRegularExpression = [[NSRegularExpression alloc] initWithPattern:@"\b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]" options:NSRegularExpressionCaseInsensitive error:nil]; } return

Problem using NSRange: Index out of bounds

你。 提交于 2020-01-03 19:33:21
问题 I am trying to detect website URL's in my string and then doing some attribution string stuff like bolding it etc. My regex is defined as: static NSRegularExpression *websiteRegularExpression; static inline NSRegularExpression * WebsiteRegularExpression() { if (!websiteRegularExpression) { websiteRegularExpression = [[NSRegularExpression alloc] initWithPattern:@"\b(https?|ftp|file)://[-A-Z0-9+&@#/%?=~_|!:,.;]*[A-Z0-9+&@#/%=~_|]" options:NSRegularExpressionCaseInsensitive error:nil]; } return

Email not working in ShareKit and no errors

心不动则不痛 提交于 2020-01-03 18:52:15
问题 I am using ShareKit to add Facebook, Twitter and email sharing to my iPhone app. Now, Facebook and Twitter are working but email is not. The big problem is that there is no error or anything, it is working just like it should but the email is not delivered to the recipient. This is what I am using to send the email [SHK setRootViewController:self]; SHKItem *item; NSURL *url = [NSURL URLWithString:@"http://www.url.com/"]; item = [SHKItem URL:url title:@"Using sharekit to share urls...."];

Higlight Artifacts When Using Hard Light Blend Mode

不羁岁月 提交于 2020-01-03 18:02:34
问题 I'm blending two images in my iPhone app, using the HardLight blend mode of the top image. It looks something like this: UIGraphicsBeginImageContext(size); [sourceImage drawInRect:rectangle blendMode:kCGBlendModeNormal alpha:1.0]; [effectOverlay drawInRect:rectangle blendMode:kCGBlendModeHardLight alpha:0.75]; mainImage.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); It works fine. However, the blown-out highlights in the image appear with a weird color

UIView. How do I place a subview behind it's parent superview

时光毁灭记忆、已成空白 提交于 2020-01-03 17:26:35
问题 I'm doing a bit of UIView wrangling and am stuck. It is straightforward changing the "z" order of sibling subviews. [mySuperview sendSubviewToBack:mySubview] places mySubview behind all it's siblings. But how do I place a subview behind it's parent? Thanks, Doug 回答1: You may want to put both into a container view, so that you can properly place one behind the other without affecting a superview not really meant to hold arbitrary views (although that will probably work just fine). 回答2: You can

CLLocationmanager: Save battery

南楼画角 提交于 2020-01-03 17:25:18
问题 My new "app in progress" uses an instance of CLLocationManager for several purposes. To make the app as battery-friendly as possible, the location services should be activated only if needed, and deactivated immediately when the data refresh is done. For my purpose it's perfectly enough to fetch the location data only once in 10 seconds. (Haven't yet decided the exact interval length). My question is, which is the most battery-efficient method of "turning off the Location services"? Is it

CLLocationmanager: Save battery

那年仲夏 提交于 2020-01-03 17:25:15
问题 My new "app in progress" uses an instance of CLLocationManager for several purposes. To make the app as battery-friendly as possible, the location services should be activated only if needed, and deactivated immediately when the data refresh is done. For my purpose it's perfectly enough to fetch the location data only once in 10 seconds. (Haven't yet decided the exact interval length). My question is, which is the most battery-efficient method of "turning off the Location services"? Is it

How to prevent subview from overlapping tab bar?

不羁岁月 提交于 2020-01-03 17:10:27
问题 I have a view with tab bar at the bottom. This view is pushed on a navigation controller, so there is also a navigation bar at the top. Unto this view, I would like to show a table view, which I create from its own nib. When I add this view as a subview, it overlaps the tab bar. Is there a way to make this subview automatically resize to the free space in between the top and bottom bar? If not, what is the 'right' way of adjusting its size to fit? -Vegar 回答1: In the interface builder make

Why would one crash log symbolicate and not another?

半腔热情 提交于 2020-01-03 17:01:05
问题 I have two crash logs from a iPhone application in XCode Organizer. Both occurred within 20 minutes of each other, on the same device, running the same build of the application. While one has been symbolicated the other has not. The unsymbolicated log has type and codes: Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x00000000, 0x00000000 Whereas the symbolicated log has type and codes: Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x61656810 Is this