Tutorial by Examples

Appearance : Happens when your script tries to send a HTTP header to the client but there already was output before, which resulted in headers to be already sent to the client. Possible Causes : Print, echo: Output from print and echo statements will terminate the opportunity to send HTTP hea...
What is XAMPP? XAMPP is the most popular PHP development environment. XAMPP is a completely free, open-source and easy to install Apache distribution containing MariaDB, PHP, and Perl. Where should I download it from? Download appropriate stable XAMPP version from their download page. Choose the ...
Detailed instructions on adding the required Camel dependencies. Maven Dependency One of the most common ways to include Apache Camel in your application is through a Maven dependency. By adding the dependency block below, Maven will resolve the Camel libraries and dependencies for you. <dep...
Assume an application with a MainActivity which can call the Next Activity using a button click. public class MainActivity extends AppCompatActivity { private final String LOG_TAG = MainActivity.class.getSimpleName(); @Override protected void onCreate(Bundle savedInstanceState) { ...
The below code example will give you an adjusted version of that color where a higher percentage will be brighter and a lower percentage will be darker. Objective-C + (UIColor *)adjustedColorForColor:(UIColor *)c : (double)percent { if (percent < 0) percent = 0; CGFloat r, g, b...
We will parse the highlighted tag data through NSXMLParser We have declared few properties as follows @property(nonatomic, strong)NSMutableArray *results; @property(nonatomic, strong)NSMutableString *parsedString; @property(nonatomic, strong)NSXMLParser *xmlParser; //Fetch xml data NSURLSe...
Pan gesture recognizers detect dragging gestures. The following example adds an image to a view controller and lets the user drag it around on screen. Objective-C - (void)viewDidLoad { [super viewDidLoad]; UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNa...
Premise The most confusing thing surrounding pointer syntax in C and C++ is that there are actually two different meanings that apply when the pointer symbol, the asterisk (*), is used with a variable. Example Firstly, you use * to declare a pointer variable. int i = 5; /* 'p' is a pointer to a...
Without Auto Layout, animation is accomplished changing a view's frame over time. With Auto Layout, the constraints dictate the view frame, so you have to animate the constraints instead. This indirection makes animation harder to visualize. Here are the ways to animate with Auto Layout: Change ...
When performing tasks asynchronously there typically becomes a need to ensure a piece of code is run on the main thread. For example you may want to hit a REST API asynchronously, but put the result in a UILabel on the screen. Before updating the UILabel you must ensure that your code is run on th...
Avoid code repetition in constructors by setting a tuple of variables with a one liner: class Contact: UIView { private var message: UILabel private var phone: UITextView required init?(coder aDecoder: NSCoder) { (message, phone) = self.dynamicType.setUp() su...
let mySwitch: UISwitch = { view.addSubview($0) $0.addTarget(self, action: "action", forControlEvents: .TouchUpInside) return $0 }(UISwitch())
@IBOutlet weak var title: UILabel! { didSet { label.textColor = UIColor.redColor() label.font = UIFont.systemFontOfSize(20) label.backgroundColor = UIColor.blueColor() } } It's also possible to both set a value and initialize it: private var loginButton = UIButton() { ...
Move every outlet to an NSObject. Then drag an Object from the library to the controller scene of the storyboard and hook the elements there. class ContactFormStyle: NSObject { @IBOutlet private weak var message: UILabel! { didSet { message.font = UIFont.systemFontOfSize(12) ...
This is similar in syntax to the example that initializes using positional constants, but requires the Then extension from https://github.com/devxoul/Then (attached below). let label = UILabel().then { $0.textAlignment = .Center $0.textColor = UIColor.blackColor( $0.text = "Hell...
//Swift let storyboard = UIStoryboard(name: "Main", bundle: NSBundle.mainBundle()) //Objective-c UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]];
//Swift let initialScreen = storyboard.instantiateInitialViewController() //Objective-c UIViewController *initailScreen = [storyboard instantiateInitialViewController];
//Swift let viewController = storyboard.instantiateViewControllerWithIdentifier("identifier") //Objective-c UIViewController *viewController = [storyboard instantiateViewControllerWithIdentifier:@"identifier"];
Strings can be assigned directly to byte arrays and visa-versa. Remember that Strings are stored in a Multi-Byte Character Set (see Remarks below) so only every other index of the resulting array will be the portion of the character that falls within the ASCII range. Dim bytes() As Byte Dim exampl...
Add a key named Required background modes in property list (.plist) file .. as following picture.. And add following code in AppDelegate.h #import <AVFoundation/AVFoundation.h> #import <AudioToolbox/AudioToolbox.h> AppDelegate.m in application didFinishLaunchingWithOptions [[...

Page 466 of 1336