My Tutorials

When to use Delegation, Notification, or Observation in iOS

Posted on Updated on

Refresh your concepts about Delegation, Notification, or Observation in iOS

Shine Solutions Group

A common problem that we often experience when developing iOS applications, is how to allow communication between our controllers, without the need to have excessive coupling. Three common patterns that appear time and time again throughout iOS applications include:

  1. Delegation
  2. Notification Center, and
  3. Key value observing

So why do we need these patterns and when should and shouldn’t they be used?

View original post 1,691 more words

“Redundant Binary Upload” Issue on iTunesConnect

Posted on Updated on

Hey Devs

If you are having following issue on new interface of iTunesConnect

“Redundant Binary Upload. There already exists a binary upload with build version ‘1.0’ for train ‘1.0’”

then you are not alone like forever alone guy. Like me and you, many others are facing this issue. But no worries, the solution is pretty simple.

More than one binary may be uploaded to iTunesConnect if the the Build number (Select the Target, then Xcode -> General -> Build, see the picture below) is increased by adding .1, i.e. if the version is 3.75, then increase it to: 3.75.1, but the Version is still `3.75 for the App (also in iTunesConnect). The build number just has to be unique for each binary that is loaded up to iTunesConnect.

NAlCV

After a new binary is uploaded and processed (~ 10 min), then you can select the new binary and submit it for review. In the picture below you may see the old and the new binary listed in iTunesConnect in the Build section of the current App version (you click the plus sign). Then the new binary is selected -> Saved -> Submit for Review. (Sometimes an error comes when submitting, then just try after a few mins or upload a new binary).

For those inclined to do this automatically with an Xcode script, here is a description of making an automatic script for updating Build numbers Better way of incrementing build number?

Note: The content of this post is extracted from this question over stakeoverflow.

Flag Counter

Beta Builder :: Wireless Distribution of Your Adhoc Archive

Posted on Updated on

Hey .. how’s work going? It’s good Han !!! … good good … So you have done with your release and verified with QA after some bug fixing; That’s great; You done a good job;

Now Its time to share the Adhoc with client; Ok … so what would you do? You will probably generate an IPA and attach it in email along with release notes.. right ??? Or you will upload it over some ftp/dropbox to let the client download and install it via iTunes … han??

Well… orite .. that’s fine.. but you know what? In both cases when client has an IPA file, he/she has to use the iTunes to sync your app in device, and in case he is away from his desk (or wants to reinstall it after deleting the old installation) he is stuck ..

Listen .. you are missing one thing here … when you have IPA files and iOS version > 4.0, you should use the web-based, wireless distribution of Adhoc apps and the ability to embed provisioning profiles right into the IPA bundle; Your test users can now install the builds without ever using iTunes at all; Doesn’t it sound good? Read the rest of this entry »

Thumbnail Based MapView Annotation

Posted on

JPSThumbnailAnnotation is an open source library to customize your MapKit annotation view for displaying image thumbnail  along with title and subtitle.  Here is a quick screenshot from my sample project using this library.

map

Setup

Its free, and open source; You need to download JPSThumbnailAnnotation library from github and drag/drop the directory into your project; You will have following six files in library;

  1. JPSThumbnail.h
  2. JPSThumbnailAnnotation.h
  3. JPSThumbnailAnnotation.m
  4. JPSThumbnailAnnotationView.h
  5. JPSThumbnailAnnotationView.m
  6. JPSThumnail.m

Usage

 import JPSThumbnailAnnotation.h and add the following line of code to add one annotation on your map view

JPSThumbnail *faisaMosqueAnnotation = [[JPSThumbnail alloc] init];
faisaMosqueAnnotation.image = [UIImage imageNamed:@"faisalMasjid.jpg"];
faisaMosqueAnnotation.title = kFaisalMasjidTitle;
faisaMosqueAnnotation.subtitle = kFaisalMasjidSubTitle;
faisaMosqueAnnotation.coordinate = CLLocationCoordinate2DMake(33.72976, 73.03698);
faisaMosqueAnnotation.disclosureBlock = ^{ NSLog(@"Faisal Mosque selected"); };
JPSThumbnailAnnotation *annotation = [[JPSThumbnailAnnotation alloc] initWithThumbnail:faisaMosqueAnnotation];
[mapView addAnnotation:annotation];

You are good to go now .. You can download a sample project from here.

Flag Counter

Happy Programming .. (:

Local history/revision of files in Xcode

Posted on Updated on

Hello friends ..extra-xcode

hope things are going good on your desk ..

Last night I was going through my tweets, and there I found something really interesting; I crawled it for few minutes and after reading some blog posts I came to know about a very useful but hidden feature that I always miss in Xcode .i.e. local history/revision of your code files; (What!! what did you say!!! Say again … ) Read the rest of this entry »

Tutorial: How to play with zip files in iOS;

Posted on Updated on

Hello Dev mates…
Hope you are enjoying your work in winters; (:

Few days back I was working on a project where I needed to compress some files to create a zip archive; Although my teammate has done much of the work, I just refined some business logic and finalized the code to complete this feature; So lets start and see how we achieved this;

1. Setup your project

  • Download an open source library from here; It is a very handy library for zip/unzip operations, written by Shannon Ai (acsolu@gmail.com)
  • Create new project in Xcode (or open your existing one)
  • Add libz.1.2.3.dylib into your project frameworks;
  • Drag and drop downloaded library into your project and chose “copy items” option from a popup window;
  • Add the following values in to your Constants file; If you are using .pch file, then declare then using @define macro; Read the rest of this entry »

How to record Audio in iOS Application;

Posted on Updated on

Hello dev mate;XcodeLogo
Hope you had a good weekend and refreshing Monday;

Today we’ll learn how to record audio in iOS application; Now a days, I’m working on an application where I need to record voice of user for some processing; I tried some framework classes from iOS sdk in a test project and here are my findings;

So lets start;

Read the rest of this entry »