Categories: iOS Posted by Nazar Rizvi on 6/23/2011 5:17 PM | Comments (1)

I have been doing very basic iOS programming these days and one of the foremost things needed for any interactive application is 'Consumption of Web Services'. 

In the first part I will be covering JSON. The easiest way to achieve this is by using the available JSON Parser for Objective-C.

Instead of me walking through the code you can go download the source-code for a sample project from my below github repository: 

https://github.com/narizvi/TwitterJsonFeed

If you have any questions feel free to contact me. 

Below is the Screenshot of the working app:

Posted by Nazar Rizvi on 5/26/2011 9:09 AM | Comments (0)

When you submit an app to app store apart from the binary and different sized icon files you also need to provide 4 Screenshots for both iPhone and iPad apps.

Apple does not want screenshots to include the phone and have specific sizes set. You can go ahead and do an print screen and crop out the picture (This is what I did in the beginning. Painful I would say) 

Instead you can do this. Xcode does provide you the ability to take screenshots. 

Before doing the following steps, please go ahead and setup your Developer Profile and PRovisioning Profile. (You can find many articles on how to do this online)

Once you have your app running on your phone follow the following steps. 

1. Connect the phone to the mac.

2. Launch Xcode and select Window->Organizer from the menu.

3. Select the Devices tab in the Organizer.

4. Select Screenshots from the left side navigation under your Phone's name.

5. And now you can run your app and take as many ScreenShots as you want by clicking on the 'New Screenshot' button.

6. Finally you can select the screenshots you want, export hem and submit to apple. No need to worry about what size the screenshot needs to be etc etc. 

Here you go Voila!!!

Categories: jQuery Posted by Nazar Rizvi on 4/8/2011 12:20 PM | Comments (0)

I have been looking at different jQuery plug-ins available for creating an album from images inside a folder. There are many great looking jQuery plug-ins to do this (Cannot argue on that)

Most of these plug-ins require you to hardcode all the images in you webpage, which is not what I would like to do. Not to mention, I personally hate creating a thumbnail of every image on my server.

Then I started looking for plug-ins which integrated Picasa albums and found Tobi Oetiker's 'Picasa Gallery Integration Plugin'. It's great works right out of the box. Once the CSS is customized it works brilliant.

Thanks Tobi...

Posted by Nazar Rizvi on 8/24/2010 10:24 AM | Comments (0)

People who deal with performance issues and high-end systems already know about the effective ways to use List<t> from System.Collections class. The msdn documentation for List<t> is available here: List<t> msdn Documentation 

Usually this will never be an issue unless you are dealing with high-performance applications or mobile applications. Whenever a new List<T> is created, the constructed capacity is 0. This utilizes minimal memory. But as you keep on adding items to the list the capacity grows exponentially i.e. 4, 8, 16, 32, 64 …

Run this piece of code to verify yourself.

Code Snippet
  1. List<string> list = new List<string>();
  2.             Console.Write(list.Capacity);
  3.             // This would output '0'
  4.  
  5.             list.Add("something");
  6.             Console.Write(list.Capacity);
  7.             // This would output '4'
  8.  
  9.             for (int i = 0; i < 4; i++)
  10.             {
  11.                 list.Add(i.ToString());
  12.             }
  13.             // List contains 5 items
  14.  
  15.             Console.Write(list.Capacity);
  16.             // This would output '8'

 

Now this can be gracefully handled by providing the capacity in the constructor as shown below:

Code Snippet
  1. List<string> newList = new List<string>();
  2.             newList.Capacity = 5;
  3.             newList.Add("junk");
  4.             Console.Write(newList.Capacity);
  5.             // This would output '5'
Posted by Nazar Rizvi on 8/8/2010 6:00 PM | Comments (0)

I have been using CoolIris for websites in order to maintain my photo gallery. Initially editing the XML manually using TextPad was cool but after few occasions it ended up being a pain to manage.  Below is a basic web form I created to upload and edit RSS feed to work with the CoolIris control I use. You can use the attached piece of code to work with your web server (Modify it as needed)

 SourceCode: