Tag Archives: xcode

Code signing error in Xcode

Had my share of code signing problem (esp. the enterprise distribution certificate) in my Xcode development. Luckily, stackoverflow rescued me as always. It seems a lot problem is due to the Xcode upgrade, project name change, provision profile/distribute certificate expiring etc. And the solution is usually delete or comment out the offending line. Like below. To go to the project file, I usually do in the command line, “cd projectName.xcodeproj”, then “vi project.pbxproj”.

http://stackoverflow.com/questions/1760518/codesign-error-provisioning-profile-cannot-be-found-after-deleting-expired-prof

http://stackoverflow.com/questions/5758154/code-sign-error-provisioning-profile-cant-be-found

I encountered another problem related to the provisioning profile expiration, the distribute certificate appears twice in the Keychain, even after I deleted it explicitly. It turns out the old distribute certificate came back after I opened the project in Xcode (presumedly it came back when the old provision profile associated with the project got loaded). So the workaround is to delete the old distribute certificate again after opening the project in Xcode.

http://stackoverflow.com/questions/5932522/codesign-error-certificate-identity-appearing-twice

Btw, saw an interesting idea from Mobile Iron regarding the enterprise distribution certificate. Normally the certificate expires in a year. In last 30 days it will prompt the user something like “the provision profile will expire in a few days…”, not good user experience. There is no way to renew it before it expires either. So the workaround suggested by MI is create 2 certificates, and create the second 6 months before the expiration and have user update the app. This way, essentially the app got extended 6 months. And so on. There is one catch in Xcode 4.3.3 I am using. It only recognizes the provision profile that was created earlier (or expires earlier). The workaround there is delete the earlier provision profile 😀

Software updates

WordPress 3.1.1
Finally I got hands around my blog (this one stlplace) and did the WordPress upgrade. I put off the upgrade in the past primarily due to my laziness: there is no automatic update due to I was running on WP 2.0.2. The upgrade itself is not too bad, I followed those two articles on Backup database and Run manual update. I used phpMyAdmin for the WP database backup. For the WP upgrade the only tricky part for me is:

“…Upload the individual files from the new wp-content folder to your existing wp-content folder, overwriting existing files. Do NOT delete your existing wp-content folder. Do NOT delete any files or folders in your existing wp-content directory (except for the one being overwritten by new files)…”

I know “directory overwriting” generally works on Windows system, but we are talking about UNIX (Linux to be precise). The command I used goes like this (in the blog root directory):

cp -r -u new_wp-content_dir .
(here -r means recursive for directories; -u means update)
I believe it did the trick, as I can run upgrade database afterwards. After that I enabled the necessary plugins. The only plugin stopped working is the ultimate warrior tags. The rest are fine.

Btw, I also added WPtouch plugin so that this blog works better on iPhone.

Xcode 3.2.6
I found my old Xcode 3.2.2 can not handle block as it’s necessary to run Ray’s RSS reader example. Download the software from Apple, install, and found this “Base SDK missing” in the new Xcode. Did some google, the trick is to “use latest SDK” in the “project => build” setting. I noticed we can also build “older” targets by changing the target in “deployment target”. Obviously there is a limit as to how far we can go back (I have not checked that yet).

Btw, I found the iPhone 4 simulator looks cooler than iPhone 3 simulator 🙂

Objective-C: first impression

I like Apple products: I had iPod Nano (2nd gen) since 2007, and I owned MacBook (white plastic), and bought iPhone for my wife this Jan. All bring us very good user experience. That is not to say, Apple products are flawless. IPod and iPhone will die once a while, but nothing catastrophic as it does not erase music etc. MacBook has minor problems too such as “could not come back to life after hibernate”, and the heat generated by battery. But I like both my old iPod nano and my fairly new MacBook (the user interface is just beautiful 😀

Ok, now back to the hard part. One reason I bought MacBook is I want to learn Objective C (the programming language on Mac OS X) and Cocoa (UI framework). My first impression (after almost a year, on and off) on Objective C and Cocoa (using XCode) is: very unforgiving, like Steve Jobs 😦

Two little stories from my own study, both on Chapter 9 NSUndoManager

Continue reading Objective-C: first impression