ios7

Strange crash in UITextview undo on iOS 7

浪尽此生 提交于 2021-02-18 11:13:32
问题 I have been receiving a bunch of crash reports that look a lot like the following with different values for the range. Sometimes the range is not 0-x it could be say 2-x Application Specific Information: * Terminating app due to uncaught exception \'NSRangeException\',reason: \'* -[NSBigMutableString substringWithRange:]: Range {0, 69} out of bounds; string length 0\' Last Exception Backtrace: 0 CoreFoundation 0x2e879e83 __exceptionPreprocess + 131 1 libobjc.A.dylib 0x38bd66c7 objc_exception

Hide status bar in iOS without removing its view

你离开我真会死。 提交于 2021-02-15 06:01:49
问题 I want to hide status bar in my iPhone app on a button press and I want to show it again on pressing another button. I tried to hide the status bar by overriding -(BOOL)prefersStatusBarHidden in my view controller but this also removes its view from the top. So a jump is seen on removing this status bar. What I want to do is just to hide the content on the status bar while keeping the background of status bar. For example: You can check the same functionality in gmail app. When you open the

Hide status bar in iOS without removing its view

时光毁灭记忆、已成空白 提交于 2021-02-15 06:00:47
问题 I want to hide status bar in my iPhone app on a button press and I want to show it again on pressing another button. I tried to hide the status bar by overriding -(BOOL)prefersStatusBarHidden in my view controller but this also removes its view from the top. So a jump is seen on removing this status bar. What I want to do is just to hide the content on the status bar while keeping the background of status bar. For example: You can check the same functionality in gmail app. When you open the

check current location is in MkPolygons

爷,独闯天下 提交于 2021-02-10 18:35:46
问题 I am working in an IOS 7 project ,it contains a location checking (current location is in given polygons). I am Using the following code to check the condition Created an array of MKPolygons for(MKPolygon *poly in self.polygonArray) { [self checkTheLocationIsInPolygon:currentLocation polygon:poly]; } - (void)checkTheLocationIsInPolygon:(CLLocation*)aLocation polygon:(MKPolygon*)aPolygon { CLLocationCoordinate2D coordinate = {aLocation.coordinate.latitude, aLocation.coordinate.longitude};

check current location is in MkPolygons

旧街凉风 提交于 2021-02-10 18:28:15
问题 I am working in an IOS 7 project ,it contains a location checking (current location is in given polygons). I am Using the following code to check the condition Created an array of MKPolygons for(MKPolygon *poly in self.polygonArray) { [self checkTheLocationIsInPolygon:currentLocation polygon:poly]; } - (void)checkTheLocationIsInPolygon:(CLLocation*)aLocation polygon:(MKPolygon*)aPolygon { CLLocationCoordinate2D coordinate = {aLocation.coordinate.latitude, aLocation.coordinate.longitude};

How to Create Two WkWebView

旧城冷巷雨未停 提交于 2021-02-08 12:14:25
问题 I am trying to create an iPhone app with two WKWebView, one for a header and one for a container. How can I create them? I can't find any utility in Xcode/Interface Builder to create WKWebview instances. I can create a WebView which is of type UIWebView, but I can't call WkWebView methods on it and I can't conversion it to a WKWebview. 回答1: var item = WKWebView() item.frame = CGRectMake(0, 0, self.view.bounds.width, 200.) self.view.addSubview(item) item = WKWebView() item.frame = CGRectMake(0

Sound is not played in push notifications

拈花ヽ惹草 提交于 2021-02-07 22:47:41
问题 I am using iOS 7 and my push notifications do not play sounds. Strangely, I found there is no setting for sound in the Preference > Notification Center for my app. Following is the screenshots of Notification center for my app: And following is that for Skype: You see, there is no 'Sounds' section for my app. Could anyone help? Update: Now I have registered sound in my app. The Notification Center now looks like: and my notification has sounds. Looks good. But after I enter the setting of my

Sound is not played in push notifications

喜夏-厌秋 提交于 2021-02-07 22:47:04
问题 I am using iOS 7 and my push notifications do not play sounds. Strangely, I found there is no setting for sound in the Preference > Notification Center for my app. Following is the screenshots of Notification center for my app: And following is that for Skype: You see, there is no 'Sounds' section for my app. Could anyone help? Update: Now I have registered sound in my app. The Notification Center now looks like: and my notification has sounds. Looks good. But after I enter the setting of my

How to use AFNetworking 2 with Digest Authentication

旧巷老猫 提交于 2021-02-07 14:40:56
问题 I've been searching for "AFNetworking 2 with Digest Authentication" for a while and haven't found useful discussions about it (except this one, but unfortunately it looks like it's for AFNetworking 1). Here's my code without authentication: NSString* apiURL = @"https://api.example.com/WS.asmx"; AFHTTPSessionManager* manager = [AFHTTPSessionManager manager]; manager.requestSerializer = [AFJSONRequestSerializer serializer]; [manager GET:apiURL parameters: [NSDictionary

How to use AFNetworking 2 with Digest Authentication

北城余情 提交于 2021-02-07 14:40:41
问题 I've been searching for "AFNetworking 2 with Digest Authentication" for a while and haven't found useful discussions about it (except this one, but unfortunately it looks like it's for AFNetworking 1). Here's my code without authentication: NSString* apiURL = @"https://api.example.com/WS.asmx"; AFHTTPSessionManager* manager = [AFHTTPSessionManager manager]; manager.requestSerializer = [AFJSONRequestSerializer serializer]; [manager GET:apiURL parameters: [NSDictionary