Featured
-
How Regression Testing Detects Integral Errors In Business Processes
Humans are forever changing and evolving and so to
by kristina.rigina -
Get Display Banner Advertising Opportunity on FindNerd Platform
“Do you have a product or service that nee
by manoj.rawat -
Android O Released with Top 7 New Features for App Developers
Android was founded by Andy Rubin, Rich Miner, Nic
by sudhanshu.tripathi -
Top 5 Features That Make Laravel the Best PHP Framework for Development
Laravel is a free open source Web Framework of PHP
by abhishek.tiwari.458 -
Objective C or Swift - Which Technology to Learn for iOS Development?
Swift programming language is completely based on
by siddharth.sindhi
Tags
IPhone alert view
To show alert view in IPhone, the following snippet will help you.
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"Message" message:@"Network error. Try again?" delegate:self cancelButtonTitle:@"NO" otherButtonTitles:@"YES", nil];
...
Handling audio files in iOS 7
The general idea for playing an audio file in iOS 6 was to create an object of AVAudioPlayer and pass the file path to it as follows:
NSURL *fileURL = [NSURL fileURLWithPath:audioFilePath];
player = [[AVAudioPlayer alloc] initWithCont...
Get a rotated image
A very good stuff that allows you to get rotated image. Sometimes we rotate the UIImageView, it appears like image is rotated but in actual it's the UIImageView which is being rotated. If we try to fetch the image from rotated UIImageView it will...
Change background and font of UIWebView
To change the Background color, Font color, Font style in UIwebview, follow the following line of code.
[webview loadHTMLString:[NSString stringWithFormat:@"<html><body style=\"background-color: red; font-size: 15; font-family: Helvet...
Date/Time Operations in php
Sometime there is a need to perform different operation on dates for ex:
You may need to :
1) Add two dates/time
2) Subtract two dates/times for ex- to calculate your age by deducting your date of birth from current date.
And many m...
Convert date into specific day of week
The following code is to convert day into specific day of week like Sunday , Monday , today , tomorrow etc. and after 7 days you want to show only that date, then this code will help you.
NSDateFormatter *formatter = [[NSDateFormatter alloc]...
Change day in date through coding.
The following code changes the day from the given "date" for example: if you want to add or subtract 5 days from the date put a value 5 or -5 respectively for "timeSliceDay".
-(NSString *)getTimeSliceDate:(NSString *)date format:(NSString *)fo...
low sound when recorded audio is played
Sometimes we record audio from AudioRecorder and when we play the same audio, it runs with a quite low volume even if volume is set to 1.0 i.e maximum.
Use below lines of code to avoid such issues:
AVAudioSession* audioSession = [AVAudioSessi...
Using Property Lists (Plists)
Method to get a value from plist
NSString *path = [[NSBundle mainBundle] pathForResource:@"PlistX" ofType:@"plist"];
NSDictionary *dict = [[NSDictionary alloc] initWithContentsOfFile:path];
int number = [[[[dict objectForKey:@"One...
Cropping image without degrading their quality (Using CIFilter's CICrop filter)
The below mentioned code uses CIImage library's CICrop filter to crop the desired area from UIImage. The follwing code deoesn't deals with snapshot as CGContextRef rather crops the original image along with maintaining its quality and aspect rati...
Crop Images without degrading their quality (Using CGContextRef)
Often the images cropped from other images in iPhone SDK are degraded in quality. This is because we take a snapshot of the original image (of the desired area). But the below mentioned code prevents from happening the above mentioned issue. The ...
How to Animate UIView
The following code sets the desired frame to a view with animation. The animation is performed with a duration of 0.4 secs (can be set according to the requirement).
[UIView animateWithDuration:0.4 animations:^{
[animateView setFram...
Avoid Strong Reference Cycles Objective C iOS sdk
How to Avoid Strong Reference Cycles
Avoid strong delegates
Avoid strong IBOutlet
Avoid strong reference variable inside the Blocks
Although strong references work well for one-way relationships between objects, you need to be carefu...