• Skip to main content
  • Skip to primary sidebar

Ravi Shankar

Tweaking Apps

  • About
  • Portfolio
  • Privacy Policy

Archives for August 2013

How to create rules in Yahoo Mail

August 29, 2013 By Ravi Shankar 1 Comment

Yahoo Mail has a feature that lets users to create filters to move the incoming messages to specific folders. This is similar to rules feature available in Microsoft Outlook that can be used for blocking emails based on subject.

Let us consider the scenario where you have subscribed to daily newsletter of a blog and want to move these emails to specific folder.

Creating filters in Yahoo Mail

Step 1: Login in to Yahoo Mail account and click Settings icon then select Mail Options from the drop down list.

image

Step 2: In the Mail Options screen, navigate to Advanced Options and click Filters.

image

Step 3:  Click the Add button available on the Filter screen.

image

Step 4: Enter name for the filter as “newsletter”

Step 5: Then enter the email address of newsletter for Sender with Criteria as “contains”. Navigate to “Then deliver the email to following folder” drop down and create new folder for newsletter.

image image

image

Step 6: Click Save button to confirm and save the changes.

Now this would move all emails from “[email protected]” to specified “newsletter” folder.

Later if you want to delete this filter then you can use the Remove Filter option available next to Add button.

image

Filed Under: Internet, Yahoo Mail Tagged With: Create Filters, Move emails, Rules, Yahoo Mail

How to change page scaling in Xcode

August 15, 2013 By Ravi Shankar Leave a Comment

Xcode provides option to increase or decrease the page scaling. This page scaling option is available as part of the Page Setup. This feature is quite useful when you want reduce the number of pages used for printing any Objective-C code.

201308152115.jpg

The default page scale is set to 100% and you can change this by following the below mentioned steps.

Click File menu and select Page Setup from the menu list.

201308152110.jpg

This should display the following Page Setup screen.

201308152112.jpg

Navigate to the Scale option and change the default value from 100% to say 50%. Then click OK button to confirm and save the changes. Now when you go to print preview screen (Xcode File menu -> Print), you should notice the effect of reduced Scale changes.

201308152118.jpg

Filed Under: Apple, Develop, ios, Xcode Tagged With: Apple, page scale, page setup, Print, Xcode

What is Delegation in iOS ?

August 15, 2013 By Ravi Shankar Leave a Comment

Delegation is one of the commonly used pattern in iOS. This is used tell an object to act on behalf of another. Refer to Apple documentation for detailed information on delegate pattern. Let us see this with an example program that uses UITextFieldDelegate.

This is a SingleView Project with one UITextField control.

#import “ViewController.h”

@interface ViewController ()

@end

@implementation ViewController

– (void)viewDidLoad

{

[super viewDidLoad];

// Do any additional setup after loading the view, typically from a nib.

UITextField *tfMessage1= [[UITextField alloc] initWithFrame:CGRectMake(50, 80, 250, 150)];

tfMessage1.borderStyle = UITextBorderStyleRoundedRect;

[self.view addSubview:tfMessage1];

}

– (void)didReceiveMemoryWarning

{

[super didReceiveMemoryWarning];

// Dispose of any resources that can be recreated.

}

@end

Now if you run the project using Xcode simulator, the UITextView will be displayed. You can type in the UITextField but when pressing Return on the keyboard will do nothing. By using delegate pattern we are going to tell UIViewController to process the pressing of the return button on behalf of UITextField and hide the keyboard.

Step 1: Open the ViewController.h file and implement the UITextViewDelegate as shown below.

#import <UIKit/UIKit.h>

@interface ViewController : UIViewController <UITextFieldDelegate>

@end

Step 2: Navigate to viewDidLoad method in implementation file, add “self.tfMessage1.delegate= self” as shown in the below code snippet.

– (void)viewDidLoad

{

[super viewDidLoad];

// Do any additional setup after loading the view, typically from a nib.

UITextField *tfMessage1= [[UITextField alloc] initWithFrame:CGRectMake(50, 80, 250, 150)];

tfMessage1.borderStyle = UITextBorderStyleRoundedRect;

[self.view addSubview:tfMessage1];

tfMessage1.delegate = self;

}

This makes the UIViewController to act on behalf of UITextField.

Step 3: Now implement the following method that would process the “Pressing of return” key.

-(BOOL)textFieldShouldReturn:(UITextField *)textField

{

[textField setUserInteractionEnabled:YES];

[textField resignFirstResponder];

return YES;

}

Filed Under: Apple, Develop, ios Tagged With: Apple, delegate pattern, delegation, Objective C

Different ways to connect IBAction to UIButton

August 13, 2013 By Ravi Shankar 2 Comments

In this tutorial, we are going to see the different ways for connecting IBAction to UIButton. Let see this with an example that displays an alert message on the touch event of UiButton.

Method 1 (Assistant Editor):

Step 1: Drag and drop Round Rect Button from the Objects library on to Interface builder.

Step 2: Now click the Show Assistant Editor option on Xcode toolbar. This should display the Interface builder and code editor adjacent to each other as shown below.
201308130927.jpg
Step 3: Select the button on Interface builder then hold control key on keyboard and drag the line to the editor window (.h file).

201308130937.jpg
You should notice Insert Outlet, Action or Outlet Collection entry as shown in the above screenshot. Selecting the option would display a window for defining the IBAction.
201308130943.jpg
Step 4: Select “Action” for Connection, provide a name (e.g.:- showAlert), Event as “Touch Up Inside” then click Connect. This should add a new IBAction entry in the header and implementation file.

Header file (.h)
201308130949.jpg
Implementation File (.m)
201308130951.jpg
Step 5 : Now add the following UIAlertView code inside the showAlert method in implementation file.

  UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@”Demo” message:@”IBAction Demo” delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];

  [alertView show];

201308130953.jpg

Executing the project in the simulator should display the following alert on tapping the Button.

201308130956.jpg

Method 2 (Connections Inspector) :

Step 1: Drag and drop a Round Rect Button on to the Interface builder.

Step 2: Navigate to implementation file and add the following IBAction code for displaying the Alert.

201308131002.jpg

Step 3: Open nib file, navigate to Show Connections Inspector option available on the left hand side.

201308131000.jpg

Selecting the File Owner’s option should display the details in the Connections Inspector. This should display the IBAction method under the Received Actions section.

201308131006.jpg

Step 4: select showAlert and drag it to the UIButton on the Interface builder.

201308131009.jpg

Releasing the mouse click should display the following Events list. Select Touch Up Inside from the list.

201308131011.jpg

Once connected, you should see the connection between the IBAction method and the control under Received Actions.

201308131012.jpg

Method 3 (Programmatically):

Step 1: Launch the implementation file for adding the Round Rect Button Programmatically.

Step 2: Add the IBAction showAlert method with the following alert message.

  UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@”Demo” message:@”IBAction Demo” delegate:self cancelButtonTitle:nil otherButtonTitles:nil, nil];

  [alertView show];

201308131002.jpg

Step 3: Navigate to ViewDidLoad Method and add the following code to instantiate UI button and connect button to Touch Up Inside event with showAlert method.

– (void)viewDidLoad

{

[super viewDidLoad];

// Do any additional setup after loading the view, typically from a nib.

  

UIButton *btnDemo = [UIButton buttonWithType:UIButtonTypeRoundedRect]; // Create Round Rect Type button.

btnDemo.frame = CGRectMake(100, 100, 100, 100); // define position and width and height for the button.

[btnDemo setTitle:@”Show Alert” forState:UIControlStateNormal];

  

//connect the showAlert method with button target attribue. Also spectify when (event) you want to call

//this methid

[btnDemo addTarget:self action:@selector(showAlert:) forControlEvents:UIControlEventTouchUpInside];

[self.view addSubview:btnDemo];

}

Filed Under: Apple, Develop, ios Tagged With: Apple, IBAction, UIButton

How to add Android virtual device in eclipse

August 12, 2013 By Ravi Shankar Leave a Comment

Android Virtual Device are used as simulator to test your Android application instead of using a real device. “No compatible targets were found” is the common message that you will receive while trying to run Android Application Project in eclipse. This occurs if there are no virtual device configured for testing the android apps.

201308121619.jpg

Now let us see how to configure a Android Virtual Device using Android Virtual Device Manager.

Step 1: Launch Android Virtual Device Manager by clicking the AVD icon in eclipse.

201308121631.jpg

Step 2: Click New button in Android Virtual Devices.

201308121632.jpg

Step 3: In the Create new Android Virtual Device (AVD) screen, choose the device simulator that you want and enter the other details as shown below.

201308121634.jpg

The AVD also provides option to configure Front and Back Camera, Memory, Internal and SD card storage. After providing the required details click OK button to confirm and save the changes.

201308121638.jpg

Now you should see the newly added Android Virtual Device in the Device Manager. Running the Android Application would launch your app on the Virtual Device.

201308121654.jpg

Filed Under: Android, Develop Tagged With: Android AVD, Eclipse, Simulator, Virtual Device

How to add YouTube video to Word 2011.

August 8, 2013 By Ravi Shankar Leave a Comment

In this tutorial we are going to see the steps required for adding videos from Youtube in Word 2011 for Mac. In Office 2011 you can not directly embed YouTube video URL. If you want to insert videos then you need to the following.

  • first download the video using third party software
  • Insert the downloaded file using Media option in Word 2011.

Download YouTube Video using third party software.

Step 1: Open http://www.mediaconverter.org/ for downloading the video from YouTube (You can also use other third party software).

201308080828.jpg

Step 2: Click Enter a link option and add the YouTube URL then click Ok button.

201308080839.jpg

201308080839.jpg

Step 3: In the media converter wizard, click go to the next step button.

201308080842.jpg

Step 4: Select the type output file. Since this is on Mac, we have gone with MP4 format. After selecting the output file format, click start conversion button.

201308080846.jpg

You should see the following status message on the media converter page.

201308080849.jpg

Step 5: Click the download link to download the converted file on to your Mac.

201308080850.jpg

Insert downloaded video file in Word 2011

Step 1: Launch Word 2011, click Insert menu and select Movie from file under Movie.

201308080856.jpg

Step 2: In the “Insert Movie or Audio” screen, select downloaded YouTube video and click Choose button.

201308080857.jpg

Now you should be able to see and play the video in your document.

201308080859.jpg

Filed Under: Apple, Mac, MS Office, Videos Tagged With: Apple, embed videos, Videos, Word 2011, YouTube

Reduce the time taken for searching iOS documentation using Xcode

August 1, 2013 By Ravi Shankar Leave a Comment

This tip is for iOS developers who want to reduce the time taken while searching iOS documentation using Xcode. Documentation under the Xcode organiser window by default shows information on OS X as well. If you are not a Mac developer then you can turn off the documentation related with OS X.

Step 1: Launch Organizer window in Xcode and navigate to Documentation tab.

201308012017.jpg

Step 2: In the Documentation window, navigate to the Search Documentation option and click the arrow pointing downwards under the search icon.

201308012022.jpg

Step 3: Now select Show Find Options from the menu list.

201308012024.jpg

201308012025.jpg

Step 4: Navigate to the Find in list box then deselect “OS X 10.7 Core Library” and “OS X 10.8 doc set”.

This would exclude the OS X library while using the documentation search on Xcode.

Filed Under: Apple, Mac, Xcode Tagged With: Apple, Documentation, search, Xcode

Primary Sidebar

Recent Posts

  • We have blocked all requests from this device – Firebase Phone Authentication
  • iPhone is not available error message in Xcode
  • Clear CocoaPods cache, re-download and reinstall all pods
  • PDFKit – View, Annotate PDF file in Swift
  • Tab Bar Controller with WebView

Archives

  • September 2020
  • April 2020
  • December 2019
  • November 2019
  • October 2019
  • February 2019
  • October 2017
  • June 2017
  • May 2017
  • March 2017
  • September 2016
  • March 2016
  • February 2016
  • January 2016
  • December 2015
  • November 2015
  • October 2015
  • September 2015
  • August 2015
  • July 2015
  • June 2015
  • May 2015
  • April 2015
  • March 2015
  • February 2015
  • January 2015
  • December 2014
  • November 2014
  • October 2014
  • September 2014
  • August 2014
  • July 2014
  • June 2014
  • April 2014
  • March 2014
  • February 2014
  • January 2014
  • December 2013
  • October 2013
  • August 2013
  • July 2013
  • June 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • November 2012
  • August 2012
  • July 2012
  • June 2012
  • May 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • April 2011
  • March 2011
  • January 2011
  • September 2010
  • August 2010
  • July 2010
  • June 2010
  • July 2009
  • March 2008

Copyright 2020 © rshankar.com