ios6

track usage of data sent and received through my app

别来无恙 提交于 2019-12-06 02:12:16
问题 How to track usage of data sent and received through my app? I just want to record bytes sent and received when my app is running. If I can get separate info for Wifi and Cellular network then it would be great but its not a priority. I know how to find total usage of device - https://stackoverflow.com/a/8014012/427969 Also, I know I can use Instruments to collect network activity data but I want to record this data in my app so need a programmatic way to do this. I tried to search this but

UISegmented Control - setting the tint color of each segment

强颜欢笑 提交于 2019-12-06 01:11:38
I have been wanting to apply different colors to my UISegmentedControl segments. Many people on here have been asking how to set tint color when you press on a certain segment. What i want to do is to set the tint color of each segment throughout the life of the application(or when the view appears on the screen). Scanning the questions on here, different people have pointed out that evidently in iOS 6 you cannot set the tintColor of each segment as such: - (void)viewDidLoad { [super viewDidLoad]; buttonNames = [NSArray arrayWithObjects:@"Red", @"Green", @"Blue", nil]; colorControl = [

Facebook Login Dialog does not work on iOS6 simulator

浪尽此生 提交于 2019-12-06 01:10:15
问题 I have been converting my application from the old Facebook SDK to the new Facebook SDK 3.1 in order to use the iOS6 native functionality as well as other Facebook functionality, and I am having a problem that happens consistently on the simulator and rarely on the device. When I go to log into Facebook, instead of the app backgrounding and authenticating through Safari or the Facebook app, I get a modal window on top of my app for the login (I believe this started with iOS6, even before

Strange JavaScript behaviour on mobile Safari iOS 6

纵然是瞬间 提交于 2019-12-06 00:59:08
I ran into a very very very strange JS issue that is reproducing only on Mobile Safari browser on iOS 6. The issue is in a function that formats a given value to a price, by stripping down the number to 2 decimals and adds the currency in front of the number. Here are the functions. I will explain later on how to reproduce the bug. formatCurrency = function(value, currency, fixedPrecision, colourize, blankIfZero) { var text; if (blankIfZero && (Math.abs(value) < 0.01 || value === undefined)) { return ""; } if (fixedPrecision) { text = currency + Math.abs(value).toFixed(2); } else { text =

Hide TabBar in iOS 6

末鹿安然 提交于 2019-12-06 00:45:58
I want to Hide my TabBar in iOS 6 , when i wrote the code which is given below it works in iOS 7 but it shows black line in iOS 6 self.tabBarController.tabBar.hidden = YES; Here is snapshot for iOS 6 : Try with below code May be this will help you... - (void)hideTabBar:(UITabBarController *) tabbarcontroller { for(UIView *view in tabbarcontroller.view.subviews) { if([view isKindOfClass:[UITabBar class]]) { if([UIScreen mainScreen].bounds.size.height==568) { [view setFrame:CGRectMake(view.frame.origin.x, 568 +20, view.frame.size.width, view.frame.size.height)]; } else { [view setFrame

UIView overriding drawRect causes view not to obey masksToBounds

心不动则不痛 提交于 2019-12-06 00:42:08
问题 I am trying to override the drawRect: method of UIView in my custom view. However, my view has a border radius defined as: sub = [[[NSBundle mainBundle] loadNibNamed:@"ProfileView" owner:self options:nil] objectAtIndex:0]; [self addSubview:sub]; [sub setUserInteractionEnabled:YES]; [self setUserInteractionEnabled:YES]; CALayer *layer = sub.layer; layer.masksToBounds = YES; layer.borderWidth = 5.0; layer.borderColor = [UIColor whiteColor].CGColor; layer.cornerRadius = 30.0; This works

Some UITextfields don't respond in iOs6

天大地大妈咪最大 提交于 2019-12-06 00:27:57
问题 Since updating to iOS 6 I have this weirdest bug when trying to make an UITextField or UITextView firstResponder. ...it doesn't work. I am not able to select the field or view and bring up the keyboard, nor is there a cursor or anything. The weirdest thing is that it is only not working for SOME fields, other ones in different viewcontrollers work without trouble. I have: [self.window makeKeyAndVisible]; self.window.rootViewController = self.viewController; in my appDelegate. It worked and

Preload next page in UIPageViewController

笑着哭i 提交于 2019-12-05 23:56:47
问题 I've looked many, many places and have yet to find some good sample code showing how to pre-load the "next" page in a UIPageViewController. There are a few answers on SO detailing some theoretical ways to do it (see this question) but no one has yet to post a working example. In the workflow of my app I'm showing 1 page per screen and I want to have the "next" screen preloaded because as it is, swiping to the next page can be very slow, sometimes requiring 2 swipes (if you swipe too fast) in

iOS6 AVAudioPlayer - AAC audio file duration always return 0

烂漫一生 提交于 2019-12-05 23:07:40
I'm porting an app that works with aac audio files to iOS6 and I've found an strange behavior, when I try to get the duration of the (valid) aac audio file, it's always returns 0, in iOS4 and iOS5 it works fine. ¿Is there any bug on AvAudioPlayer class that affects duration property? I have read about some troubles with the currentTime property. Here's the code: NSURL* urlFichero = [NSURL fileURLWithPath:rutaFichero]; avaPlayer = [[AVAudioPlayer alloc] initWithContentsOfURL: urlFichero error:nil]; segundos = avaPlayer.duration; NSLog(@"[ControladorFicheros] Fichero: '%@' Duración: '%f'",

didReceiveLocalNotification method not called in app delegate when app is in background [iOS6]

别等时光非礼了梦想. 提交于 2019-12-05 22:30:52
I have added a local notification, it is getting triggered as well by displaying a banner on iOS6 and displaying alert in iOS5. But in iOS6 the "didReceiveLocalNotification" method in app delegate is not getting called. How can I know that a notification has occurred when the application is in the background ? Thanks. Leena It will never gets called in background. It will be called when your app is in foreground. Check UIApplicationDelegate Protocol Reference link for more info 来源: https://stackoverflow.com/questions/13678499/didreceivelocalnotification-method-not-called-in-app-delegate-when