Sunday, April 11, 2010

Obj-C | For beginners

A quick obj-c cheat-sheet for the beginners. This is taken from RWTH-iPhone Application Programming. You can also download complete videos from iTunesU.

Thursday, April 8, 2010

Batch renaming of files (Mac OSX / *nix)

How to batch/bulk rename files with automatic sequence number? Try the following shell script from your terminal (OSX/*nix)

1. Create a new directory <newdir>
2. Run the following command (you can replace newdir with the your directory name and some_prefix with your prefix the same applicable for extension as well. My eg., rename only the png files of the directory (there were no other extensions available).

i=0; for x in *.png; do cp \"$x\" "newdir/some_prefix_$i.png"; i=$(($i+1)); done

Windows should have supported bash scripts natively. OSX is handy only because they inherited from unix.

Sunday, April 4, 2010

[BEROR]Code Sign error: Provisioning profile '579ACFD8-827A-4325-F623-DB8CDD5081DB' can't be found

Check dependencies Code Sign error: Provisioning profile

[BEROR]Code Sign error: Provisioning profile '579ACFD8-827A-4325-F623-DB8CDD5081DB' can't be found

Anyone who is relatively new to iPhone development could easily identify this issue is related to the invalid provisioning profile.

What if you receive this error even if you provide valid device, dev certificate, provisioning profile and bundle identifier? No clue right. I spent almost a day on finding the issue.

This can be resolved by copying all your classes/resources/other files to a newly created project. Easy solution isn’t it? but my case is different, the project was already renamed (Google on how to rename xcodeproj and the steps involved). As the project given to me was already renamed hence it has different name for xcodeproj, different name for appdelegate and another name for info.plist file, copying all the files to a new project is real pain. To add oil to the fire I was supposed to deliver the code to my QA to test the build on device before sending the code to customer by EOD and it was a Friday.

Solution:

All you have to do is find the provisioning profile ID in your project.pbxprj file and replace it with valid provisioning profile that you had tried to build the code earlier.

  • Step 1: Open the project.pbxproj file in a text editor. (you will find this file in YourProject/YourProject.xcodeproj by control-clicking it and selecting "Show Package Contents")
  • Step 2: Replace all occurrences of the provisioning profile id from the error with the correct provisioning profile id from the organizer.

Screenshots:

How to find project.pbxproj

Right click (Ctrl+click) your prjname.xcodeproj file and select “Show Package Contents”. This will open the Finder with some files.

packagecontents

 project

 

Find valid profile identifier of your provisioning file
organizer

 

Where to replace the profile identifier
pbxprojx

Related Issue

Check dependencies

[BEROR]CodeSign error: no provisioning profile at path '/Users/username/Library/MobileDevice/Provisioning Profiles/579ACFD8-827A-4325-F623-DB8CDD5081DB.mobileprovision'

 

The solution to the above error -  Rename your appname.mobileprovision with (alpha-numeric-name) specified in the error.

 

--
Dr.P

 

 

P.S
Thank you Anders for correcting the text.

Why AppStore submission process sucks!

They only check the binary to see if they use any private API nothing other than that. Sometimes they reject the app and give you a reason that it doesn't fit with their HIG standards. Eg., one of our app got rejected for this reason. They said + button should be used when you use add contacts to the app from Address book. But the same + icon was used in USA Today app and is available in appstore. Moreover we just copied the idea to have + to show larger images.



If you help your customer from saving time to find the good apps and you concern about their security then you should have more checklist other than plain API lookup in the binary. For eg., there is an app called 53000+ Famous Quotes but actually it contains around 32100 quotes only. Please refer the image below.
53000 FamousQuotes
Like the same there are many apps that doesn’t even match the name. eg., Finger security lite.
--
Dr.P