Thursday, December 20, 2012

Having problem on creating .ipa file from Xcode's "Product -> Archive" or "Build & Archive" method ?

                 Creating an IPA is done in a simple way from your Xcode : Product -> Archive (previously Build & Archive). After the Archive operation completes, go to the Organizer, select your archive, select Share and in the "Select the content and options for sharing:" pane set Contents to "iOS App Store Package (.ipa) and Identity to iPhone Distribution (which should match your ad hoc/app store provisioning profile for the project).
It's a simple stuff to do but BANggggg... You might be in trouble if you have been using some other static library, third party library, other xcode project files in your project. You might have following issue that disables your .ipa file selection :
 “No Packager exists for the type of archive and This kind of archive cannot be signed."

Wednesday, December 19, 2012

Opening iOS Apps from Browser or any other source using URL Scheme in iOS Devices

In this section, i will be describing about how to open up an app in iOS device either from a Browser or from any other application present in iOS devices.

First thing you need to do is to register a URL scheme  in to device which is done in your app's info.plist file. URL Scheme will be your key to open up your app from browser or any other app. Here are the step by step procedure :
First open up your info.plist
Step 1. Right-Click and “Add Row”
screen-capture.png

Wednesday, October 3, 2012

"Pull Down To Refresh" integration for updating data in UITableViews

Hello Guyz , in this section we will be talking about "Pull Down To Refresh" integration for updating your data in UITableView. This kind of effect can be seen in  facebook app, where we  pull down the view and it refreshes/updates the facebook feeds. In the similar way, in this section i will write a bunch of codes that basically do is: when we pull down the UITableView, it will updates its datasource and reload the table section. Here, is the example screen that will help you to understand about this effect more wisely.
download and add this dropdown image to be used in project named updateArrow.png

Tuesday, October 2, 2012

Rate/Review apps in iTuneStore from inside iOS application

Hello Guyz, in this section i will describe you, how we can write a review or rate an app in iTuneStore from inside iOS Application by writing few lines of code. The example i am showing here will directly open up the iTuneStore review section of your app  in your device (to be noted is that the bunch of code i am writing here will only work on actual device.)

-(IBAction) rateAndReviewInItuneStore:(id)sender{
 NSString* url = [NSString stringWithFormat: @"itms-apps://ax.itunes.apple.com/WebObjects/MZStore.woa/wa/viewContentsUserReviews?type=Purple+Software&id=%@",AppID];
     [[UIApplication sharedApplication] openURL: [NSURL URLWithString: url ]];

}
Here, AppID = your Apple ID in your iTuneStore , can be found inside your app  in iTuneStore and under "App Infromation" section of your app (9 digit numbers).

"Follow us on Twitter" button integration in iOS Application

Hello Guyz, In this section i will show you the two different way to integrate "Follow us on Twitter" button from inside our iOS App. If you are a twitter user then you probably got what i am talking about. "Follow us" button is very popular in web apps, by integrating it we can directly follow some people or organization depending on the twitter screen name we choose to follow and in this section i will show you how we can integrate it from inside our iOS apps.

Method 1: Without using any API
 Without plugging into native twitter app or  using any other API in code, we could simple open a URL to do the job of Following some one in twitter.
-(IBAction)FollowUsOnTwitter:(id)sender {
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"https://twitter.com/intent/user?screen_name=%@",TwitterAccountName]]];
}
Note : TwitterAccountName = your twitter account name you wish to follow, and it will open to follow that account in the browser.

Method 2: Using Twitter Framework for iOS 5 and later
  To be noted here is that Twitter framework is available  only for  iOS 5 and later version.
- First of all , add "Twitter.framework" and "Accounts.framework" to your project.
- now include #import <Accounts/Accounts.h> and #import <Twitter/Twitter.h> to your .h file.

Thursday, September 20, 2012

Moving Images/Objects around the screen using Touch function in iOS app

Hi Guyz, in this section i will give you the idea of moving your objects(Image in our case) in the screen using Touch function. In previous blog, we talked about the drag and drop method, where we were dragging some object from one position and dropping it to  another one but in this section we are only going to reposition/move the object in the screen.So basically in this section, we will see how the multiple images moved using touch function. Lets get started !!!!

Create multiple (say 4 in our case) UIImageView in your viewcontroller and connect it to the IBOutlet and assign them with different images.
In your .h file ;
  @property(nonatomic,retain) IBOutlet UIImageView *imageView1;
  @property(nonatomic,retain) IBOutlet UIImageView *imageView2; 
  @property(nonatomic,retain) IBOutlet UIImageView *imageView3;  
  @property(nonatomic,retain) IBOutlet UIImageView *imageView4; 
In your .m file,
  @synthesize imageView1,imageView2,imageView3,imageView4;
Now,use Touch delegate method as :
  - (void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
       // get touch event
    UITouch *touch = [[event allTouches] anyObject];
    CGPoint touchLocation = [touch locationInView:self.view];
     if ([touch view] ==
imageView1) { // If touched view is imageView1 , then assign it its new location
               
imageView1.center = touchLocation;
    }
       else if ([touch view] ==
imageView2) {
          
imageView2.center = touchLocation;
    }
    else if ([touch view] ==
imageView3) {
              
imageView3.center = touchLocation;
    }
    else if ([touch view] ==
imageView4) {
              
imageView4.center = touchLocation;
    }
}

 So that's it!! so simple to move objects around the screen in iOS apps.


Tuesday, September 18, 2012

Draging and Droping objects in iOS App

Hi Guyz, in this section i will  describe you how to drag any particular views/objects and dropping it somewhere else. This is the nice feature  mostly seen in web apps, but here i will be detailing how to use this features in iOS Apps. In this demo, we will be changing the background color of UIView (where we will be dropping objects) depending on the dragged object's color and i will also give you a hint to change the position(repositioning it) of dragged object's as a result of Drag and Drop.
Lets get started !!!!

First design your  ViewController.xib file  as in figure with four dragging objects(here,UIImageView) and one UIView (as dropping target view). Change the background color of all 4 UIImageViews.
Now in .h file,
   // connect target UIView in Interface Builder
@property (nonatomic, strong) IBOutlet UIView *dropTargetView;
     // define temp UIImageView for view being dragged
@property (nonatomic, strong)  UIImageView *dragObjectView; 
    //distance between the actual touch point and the upper left corner of the dragObject
@property (nonatomic, assign) CGPoint touchOffset;
  // drag object's original position  in screen
@property (nonatomic, assign) CGPoint homePosition;