Tag: ios

iOS Parse.com inner query doesn't fetch all objects

I am getting trouble with parse.com inner query using. Here is my code. PFQuery *innerQuery = [PFUser query]; [innerQuery whereKey:@”deactive” equalTo:[NSNumber numberWithBool:NO]]; PFQuery *query = [PFQuery queryWithClassName:@”Post”]; [query orderByDescending:@”voteCount”]; [query setLimit:1]; [query whereKey:@”user” matchesQuery:innerQuery]; [query findObjectsInBackgroundWithBlock:^(NSArray objects, NSError error) { //some code }]; Here is a problem. Inner query max limit count is 1000 as […]

MapView: Use MKUserTrackingBarButtonItem to toggle map tracking state

I have added a MKUserTrackingBarButtonItem to my toolbar. But, clicking it does nothing. So, I assumed I need to use addTarget like a normal UIBarButtonItem but that doesn’t work either. How can I attach a method to that button so that I can change setUserTrackingMode:animated:? MKUserTrackingBarButtonItem *trackingItem = [[[MKUserTrackingBarButtonItem alloc] initWithMapView:mapView] autorelease]; UISegmentedControl *segmentedControl = […]

Resizable Centered Circular UIView

I am looking for a way to create a CIRCULAR UIView that is resizable and stays centered (see image). The CIRCULAR view in this example is a UIView subclass WCSDailyGoal. ContainerView.m – (void)createDailyGoalView { _dailyGoalView = [[WCSDailyGoalView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)]; _dailyGoalView.delegate = self; _dailyGoalView.goal = 200; _dailyGoalView.center = self.view.center; [self.view addSubview:_dailyGoalView]; } WCSDailyGoal.m […]

AVAudioSession mixing with AVSpeechUtterance

I have an issue where I would like to have the iPod playing music in the background and in my application I would like to have AVSpeechUtterance lower the volume of the iPod, play a string of text and then I would like to have the iPod resume playing. I have tried several things but […]

How to apply transform in UIView?

I have applied below transform to UIView’s layer like this: CATransform3D rotationAndPerspectiveTransform = CATransform3DIdentity; rotationAndPerspectiveTransform.m34 = 1.0 / -850; rotationAndPerspectiveTransform = CATransform3DRotate(rotationAndPerspectiveTransform, M_PI_4*1.1,0.0f, 1.2f, 0.0f); self.centerView.layer.transform = rotationAndPerspectiveTransform; But not so much success i just wanted to apply transform like shown below image Any help would so much appreciated. Thanks for reading my Question

Add ADBannerView to a SKScene

I’m trying to add an iAd banner to my game over scene, but I don’t know how to add UIView to an SKScene. The app view controller is: – (void)viewWillLayoutSubviews { [super viewWillLayoutSubviews]; // Configure the view. SKView * skView = (SKView *)self.view; skView.showsFPS = YES; skView.showsNodeCount = YES; // Create and configure the scene. […]

Can IOS devices stream m3u8 segmented video from the local file system using html5 video and phonegap/cordova?

I’m using phonegap/cordova 2.1 and my app has locally stored assets (on the device) which need to be encrypted on build and decrypted in memory when used in execution. The app is for iPad only. For the videos I want to implement something similar to http://codebycoffee.com/2012/01/08/decrypting-http-streaming-video-with-nsurlprotocol where mediafilesegmenter is used to segment and encrypt each […]

Countdown NSTimer in title of a UIAlertController getting a null instead of time in seconds

I’m trying to display a countdown in the title of a UIAlertController. I want to have something like “Your session is going to expire in X seconds”. My thought process was to create an NSTimer and store the time in an NSString stringWithFormat and have that string be the title of the alert controller. Here […]

In CBCentralManager delegate method didDiscoverPeripheral: never called

I initialize the CBCenteralManager in viewdidload on main queue. First time update state method is called and start scanning for bluetooth devices but didDiscoverPeripheral: delegate method never get called. Code is : – (void)viewDidLoad { [super viewDidLoad]; self.CM = [[CBCentralManager alloc]initWithDelegate:self queue:nil]; } -(void)centralManagerDidUpdateState:(CBCentralManager *)central{ if (central.state == CBCentralManagerStatePoweredOn) { [self.CM scanForPeripheralsWithServices:nil options:nil]; } } […]

how to get return in AFHTTPRequestOperationManager request in afnetworking

Hi i am posting data in using AFHTTPRequestOperationManager class getting the response from server but not able to return data . method return is executed first then success data is coming i want to get the value in return . this is my code .h file @interface ServerRequest : NSObject { } -(NSString *) JsonData:(NSString […]