" Live as if you were to die tomorrow. Learn as if you were to live forever.. "
- Mahatma Gandhi

Animating whole Window-based iPhone Application.

Posted on November 24th, 2015 by Deepak Vashisht

In a window based App, if we want the whole application to be animated then we have to write code for animation in each views that has been added to the application. –>I have another solution that saves time and easier to implement.   This can be done simply by writing few lines of code. […]

To add your app in NewsStand add the following key in Info.plist

Posted on November 24th, 2015 by Abhishek Gupta

To add your app in NewsStand add the following key in Info.plist <key>UINewsstandApp</key> <true/> Now your app is NewsstandApp. But to show your app in newsstand you need add the newsstand icon in the info.plist that are different from the application icon. Adding the newsstand icon to info.plist:   <key>CFBundleIcon</key> <dict> <key>CFBundlePrimaryIcon</key> // these are […]

Add your app in the Newsstand

Posted on November 24th, 2015 by Abhishek Gupta

To add your app in NewsStand add the following key in Info.plist <key>UINewsstandApp</key> <true/> Now your app is NewsstandApp. But to show your app in newsstand you need add the newsstand icon in the info.plist that are different from the application icon. Adding the newsstand icon to info.plist:   <key>CFBundleIcon</key> <dict> <key>CFBundlePrimaryIcon</key> // these are […]

Adding Menu to UInavigationbar

Posted on November 24th, 2015 by Priye Saurabh

Menu Bar is not a custom control But we can design it easily using two UIView ,UIButton and UIlabel. Just on button action we can remove it from superview the one containing list. But generally adding it to navigation bar  is a bit tricky.  General Idea (Menu) We can use  two views one containing one label […]

Showing PopOver on tapping button in WebView using JavaScript.

Posted on November 24th, 2015 by Shilpa Kadiyan

Using JavaScript, we can find the location of the buttons by using below code. Here is the script that’s to be run before calling the position Function.Below script is having theposition function(func to calculate the X and Y coordinate of buttons)   [_webViewstringByEvaluatingJavaScriptFromString:@”var script = document.createElement(‘script’);” “script.type = ‘text/javascript’;” “script.text = \”function positionX(id){ ” “{” […]

Merging Two Videos | iPhone/iPad Tip

Posted on November 24th, 2015 by Priye Saurabh

Suppose you have two video files with name video1.mp4 and video2.mp4 and want to merge them into a single video programmatically this tip might help you. Follow the instructions given below- First, we need to add following frameworks in our project: a)AVFoundation  framework b)Asset Library framework c)Media Player Framework d)Core Media frame work Then we need […]

How To Set The Navigation Bar’s Background Image Directly

Posted on November 24th, 2015 by Shilpa Kadiyan

Set the image using method setBackgroundImage:forBarMetrics.   [[UINavigationBarappearance] setBackgroundImage: portrait forBarMetrics:UIBarMetricsDefault]; [[UINavigationBarappearance] setBackgroundImage: landscape forBarMetrics:UIBarMetricsLandscapePhone]; Create resizable images UIImage *portrait = [[UIImageimageNamed:@”image1″] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0, 0)]; UIImage *landscape = [[UIImage imageNamed:@”image2″] resizableImageWithCapInsets:UIEdgeInsetsMake(0, 0, 0,0)]; Set the attributes of Naviagtion Bar (to set the title font, color, shadowoffset)   [[UINavigationBarappearance] setTitleTextAttributes: [NSDictionarydictionaryWithObjectsAndKeys: [UIColorcolorWithRed:255.0/255.0green:255.0/255.0blue:255.0/255.0alpha:1.0], UITextAttributeTextColor, [UIColorcolorWithRed:0.0green:0.0blue:0.0alpha:0.8], UITextAttributeTextShadowColor, […]

How to stop copy, paste options on text on iPhone.

Posted on November 24th, 2015 by Surbhi Garg

We can stop Copy, Paste on Text boxes and Text views, or any text on iphone on hard press on them, on a UIView by including this method in .m file   – (BOOL) canPerformAction:(SEL)action withSender:(id)sender { if ([UIMenuController sharedMenuController]) { [UIMenuController sharedMenuController].menuVisible = NO; } return NO; }  

Handling Phone Keyboard With A DONE Button And A Default Keyboard On The Same View

Posted on November 24th, 2015 by Surbhi Garg

We can handle these by Calling Notifications for KeyboardDidShow/ KeyboardWillShow methods. But when default KeyBoard is there on the screen at that time these notification methods are not called in that case we have to call the method for calling the DONE button as the keyboard subview. On the DONE button press we can remove […]

How to resolve project.pbxproj file issue in Xcode

Posted on November 24th, 2015 by Subrat Kheti

Basically, in a project if more than one developer are working and one developer has added some files(it may be .h,.m or any .png)  and commits the project including .xcodeProj in source control management. But due to some reason developer  removes files or images from the project  and also removes the use of those files […]

iPhone/iPad Tip: How to merge two images into a single image

Posted on November 24th, 2015 by Kapil Kumar

Merging two images to create one single image file. Suppose we have two images with name file1.png and file2.png The code below merges two images.   @implementation LandscapeImage – (void) createLandscapeImages { CGSize offScreenSize = CGSizeMake(2048, 1380); UIGraphicsBeginImageContext(offScreenSize); //Fetch First image and draw in rect UIImage* imageLeft = [UIImage imageNamed:@”file1.png”]; CGRect rect = CGRectMake(0, 0, […]

Using imageWithContentsOfFile instead of imageNamed of UIImage

Posted on November 24th, 2015 by Abhinav Singh

So often while coding we use the imageNamed function of the UIImage whenever we have to load an image from resource folder but there is problem associated with it as it always caches the image. Suppose you are loading images for some photoscroller type of application, or in a scrollview, etc and loading many images […]

How to post message on your facebook wall without using Facebook dialog Box

Posted on November 24th, 2015 by Subrat Kheti

On certain condition if we want to post some message on Facebook wall without using Facebook dialog box but by using a customize box having a textField. It can be achieved using GraphAPI. I am assuming already you  have a box with UITextField and button as postToFacebook. And what ever we have written on that […]

Removing all characters within HTML tag from a string iOS Development

Posted on November 24th, 2015 by Deepak Vashisht

In many applications , there is a need to retrieve a specific portion of data from a string or to remove a few lines of text present at various places inside a string. This can be performed in various ways. I am taking HTML string and using various method replacing data present within the tag […]

Handle Touch Event on WebView

Posted on November 24th, 2015 by Waseem Ahmad

 Generally UIWebView does not support the Touch Event directly. We can handle it,  using the UIGestureRecognizer. For this we need to implement it’s delegate method which always return true. – (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer; #import <UIKit/UIKit.h> @interface WebTocuh : UIWebView<UIGestureRecognizerDelegate> @end @implementation WebTocuh – (id)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { UITapGestureRecognizer* tabGesture […]

How to open a location using google map by passing the location name

Posted on November 24th, 2015 by Subrat Kheti

  //Address we want to search NSString* addressText = @”Mindfire Solutions,SaritaVihar,NewDelhi”; NSString* searchQuery = [addressText stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding]; NSString* urlString = [NSString stringWithFormat:@”http://maps.google.com/maps?q=%@”, searchQuery]; //open the specified location on googleMap [[UIApplication sharedApplication] openURL:[NSURL URLWithString:urlString]]; We can use it as method and pass the address as string. on calling the method the googlemap open and show the […]

Combining two bundles under single archive

Posted on November 24th, 2015 by Rinku Dahiya

Whenever we have any static library in our project and we want to make archive( .ipa) of that project. Compiler won’t allow us to make archive of that as it shows an warning ““[Project name] does not contain a single–bundle application or contains multiple products” error in Xcode 4.2. So, there is only a single […]

Using Groups: How to retrieve data from Photos Application in iOS device

Posted on November 24th, 2015 by Deepak Vashisht

n many a application, we need to fetch photos from Photos application of the iOS device. And for that developer normally use UIImagePickerView that has a default layout and using that we can access photo library of the device. But in case we want to create custom views within the application for photo albums, for […]

Opening Any IPhone Application Created By You By A Link Using Safari Browser

Posted on November 24th, 2015 by Rinku Dahiya

Step 1.  Open up info.plistof the project (Application) in the Xcode.  Step 2.  Right click on any of the property field there. And choose “Add Row” from the popup menu.  Step 3.  Select “URL types” as the Key in that new row.  Step 4.  Expand “Item 1” and provide a value for the URL identifier. This can be […]

How to remove the issue when dealloc is not getting called.

Posted on November 24th, 2015 by Surbhi Garg

Have you ever come across a problem where dealloc of ViewController was not getting called? Yes, there can be a case where it can happen. I was adding a View as subview to another View like as follows [self.view addSubview:_secondViewController.view]; _secondViewController is an object of SecondViewController SecondViewController has a Valid NSTimer object. then i remove […]

Difference between @Class and #import in Objective C

Posted on November 23rd, 2015 by Surbhi Garg

  @Class- Is used when we only want to declare the object of any class.. For example: in .h file @class Mindfire; @interface MindfireSolutions :UIViewController { Mindfire* _mindfire; —- }     This is done because neither we want to use the methods of “Mindfire” Class at this time nor we want to set the […]