Tag: ios

jailbroken iOS taking screenshot from background app

I’m building an utility app for myself that can take screenshots of whatever is running in the foreground while this utility is running in the background. The utility will be running on a jailbroken device so it can access private APIs and not confined to the sandbox. Since the utility app is running in the […]

XCODE: How to get/verify ACCURATE timestamp from device

Is it possible to get the NTP or accurate timestamp without internet connection? I cannot take/don’t trust device timestamp with [NSDate date] as it can be modify by user and my apps will be hacked by just modifying the system date & time. Apart from this, instead of obtain accurate timestamp, is there any way […]

How do I know if text exceeds the bounds of a text view?

I would like to know when text exceeds the bounds of a UITextView and requires the user to scroll. Knowing how many lines a certain font will occupy is useless – how do I know how many lines a certain amount of text will take up? In the image above, I would add a fade […]

locationOfTouch and numberOfTouches

hi I have this recognizer, set with 2 touch, but it returns only one, not two CGPoint -(void)gestureLoad { UIGestureRecognizer *recognizer; recognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(numTap2:)]; [(UITapGestureRecognizer *)recognizer setNumberOfTouchesRequired:2]; [self.view addGestureRecognizer:recognizer]; self.tapRecognizer = (UITapGestureRecognizer *)recognizer; recognizer.delegate = self; [recognizer release]; } – (void)numTap2:(UITapGestureRecognizer *)recognizer { CGPoint location = [recognizer locationInView:self.view]; NSLog(@”x %f y %f”,location.x, […]

How to convert FLAC file to wav file in ios?

I want to create a audio player that support Flac format of audio files.For this i tried to implement the algorithm of flac to wav conversion which is as follow Please help me. All time it gives me error ERROR: initializing decoder: FLAC__STREAM_DECODER_INIT_STATUS_ERROR_OPENING_FILE static FLAC__bool write_little_endian_uint16(FILE *f, FLAC__uint16 x) { return fputc(x, f) != EOF […]

Objective C: How to resolve 'unrecognized selector sent to instance' error

I am trying to access a property of instance object using the following code for (User *user in likersArray) { //Set variables for dictionary NSString *nameLength = [NSString stringWithFormat:@”%i”,[user.nickname length]]; } However, I keep getting the following error: *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘-[NSCFString nickname]: unrecognized selector sent to instance 0x8c0f780’ […]

Adding address book in contact page

I want to add an address book in my contact page and I want to do that programmatically i.e without using nib files. Can anyone suggest me a nice tutorial or sample code for that. i have used the codes of the answer given by iPatel and when i am running it is throwing exception […]

ObjectiveC Blocks and Variables

I have the following method that makes a webservice call from my iOS app (using Restkit)… BOOL valid = NO; RKObjectManager *objectManager = [RKObjectManager sharedManager]; NSString *servicePath = [WebServiceHelper pathForServiceOperation:[NSString stringWithFormat:@”/security/isSessionValid/%@”, username]]; [objectManager getObjectsAtPath:servicePath parameters:nil success:^(RKObjectRequestOperation *operation, RKMappingResult *mappingResult) { BooleanServiceResponse *resp = [mappingResult firstObject]; valid = resp.value; } failure:^(RKObjectRequestOperation *operation, NSError *error) { NSLog(@”Error […]

AVAudioPlayer doesn't play audio in iPhone 5 when locked

Using AVAudioPlayer I’m trying to play sounds while the iphone player is playing. Also when device is locked. The thing is, that in iPhone 4s ios 7 – works fine. But on iPhone 5 with 6 and 7 ios nothing happens. In the -Info.plist in Required background modes I wrote App plays audio or streams […]

ViewController With Transparent Background Entering Current ViewController With Push Transition

I have this story board : my first ViewController has PNG image as background programatically : – (void)viewDidLoad { [super viewDidLoad]; self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@”bgleft”]]; } my second ViewController has transparent background by selecting Clear Color as Background property on Storyboard. but when it runs on my iPod, it seems that my second ViewController […]