Categories
iPhone app

iOS training classes in St. Louis area

Reading Time: < 1 minute

Disclaimer: not including any commercial providers here, as they are usually more expensive. With today’s online learning resources (raywenderlich.com tutorial, stackoverflow to say a few), it’s fairly straightforward for an experienced developer to pick up Objective C and UIKit, etc. I think the value of classes is mostly from interaction with instructors, and do some real life projects.

wustl

slu

umsl

St. Charles Community College

Last but not least, the St. Louis iOS group led by Brian Coyner. The format is different from the training class, but it’s a good place to hang out with fellow iOS developers in the area. For that matter, there is a mobile dev group with an emphasis on Android (led by Heath Borders) as well.

Categories
iPhone app

iOS 7 articles

Reading Time: < 1 minute

http://mattgemmell.com/2013/06/12/ios-7/

http://blog.mengto.com/ios-7-transition-flat/

http://designmodo.com/flat-design-principles/

http://www.marco.org/2013/06/27/ios7-as-defense

http://whoo.ps/2013/05/12/flat-design-is-great-for-mediocre-designers-like-me

Categories
iPhone app

5 ways to do the callbacks in objective C and iOS dev

Reading Time: < 1 minute

1. Selector
http://stackoverflow.com/questions/3482344/what-actually-is-a-selector

An example
http://stackoverflow.com/questions/10758926/add-selector-to-uibutton
[button addTarget:yourObject action:@selector(yourMethod:) forControlEvents:UIControlEventTouchUpInside];

2. NSNotifications
In a way (and in syntax too) it’s similar to Selector, but used in different settings.

example here
http://www.cocoanetics.com/2009/08/love-to-be-notified/

3. Delegate methods
e.g., UIAlert view, UITextField delegate

customized method (example)
http://www.raywenderlich.com/29474/ipad-for-iphone-developers-101-in-ios-6-custom-input-view-tutorial

4. Blocks
https://developer.apple.com/library/mac/#featuredarticles/BuildingWithBlocks/_index.html

example
http://stackoverflow.com/questions/7180552/implementing-a-method-taking-a-block-to-use-as-callback

5. GCD
My favorite example here.
http://www.fieryrobot.com/blog/2010/07/10/a-watchdog-timer-in-gcd/

Combinations of some of the above, e.g, blocks (GCD) with notification

Categories
Fun iPhone app

Objective-C code hall of shame

Reading Time: < 1 minute

Today I found out I made a dumb mistake while deleting an NSMutableArray.

for(int ii=0; ii<[myNSMutableArray count]; ii++) { myNSMutableArray removeObjectAtIndex:ii]; } The reason being it will get confused about the elements (index) during the loop. The correct way is to use removeAllObjects method.

Categories
iPhone app Software development

Code signing error in Xcode

Reading Time: 2 minutes

(Update 08-Dec-2020) Things I learned today (or tomorrow am 🙂

  1. One team can have at most two distribution certs
  2. In Xcode sign in as agent without the (mail.com or gmail.com after @) because it appears my apple id is just the id without all the @ + dot com stuff. That alone cost me probably one hour. Plus the one hour I tried to export cert in old MacBook, then move it over to the new MacBook. So totally 2 hours wasted… after those two steps, I was able to go back to automatically signing and validate my archive (ipa) for myNestEgg…

Managing a Distribution Certificate

No signing certificate “iOS Distribution” found

Create, export, and delete signing certificates

====

For organizations, if a distribution certificate is missing a private key or not in your keychain, you can email the creator of the signing certificate. Ask the creator to export the signing certificate on their Mac so you can install it on your Mac. (To install a certificate in your keychain, double-click the exported certificate file.)

====

What is app signing?

Creating the iOS Distribution Certificate

iOS – Creating a Distribution Certificate and .p12 File

(Original 06-Feb-2013) 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 😀

Categories
Software development Web Windows

Consuming a PHP SOAP web service from C# client

Reading Time: < 1 minute

I need to create a SOAP client in C#, and in order to test it I need a SOAP web service. Since my hosting company uses MySQL/PHP technology stack, I am using this PHP Soap web service example.

For the C# soap client, I am following this example on stackoverflow. But there is one problem when I tried to run the example. I got the error (exception) like the following:
The content type text/xml; charset=ISO-8859-1 of the response message does not match the content type of the binding (text/xml; charset=utf-8). If using a custom encoder, be sure that the IsContentTypeSupported method is implemented properly.

Again I found this thread on stackoverflow which seems relevant. It talked about the custom message encoder developed by Microsoft, and Paul Morgado’s addition to the CustomTextMessageEncoder class (just add his method at the end of the class). There is one more thing, the configuration file for the app. In my case, it’s something like the following: (note the messageVersion and bindingElementExtensions definition, there was some error in the Microsoft documentation regarding the latter one).

Categories
Software development

Set up SVN (Subversion) on local machine (Windows)

Reading Time: < 1 minute

I need to do some development work on Windows, using Visual Studio. I like to have a simple source code control system, in recent years I have used CVS, Subversion and git (on Mac). I did a google search on Subversion and found some instructions regarding setting up Subversion.

Setting up Subversion on Windows

and this one

Installing and Configuring SVNServe and TortoiseSVN on Windows

Download/install the SVN server and starting the windows service was relatively straightforward. So as the Tortoise SVN client. Couple things keep in mind:

1) Some sites requires registration or install additional software, I chose sites that does not require registration.

2) I found sometimes I can not open up svn://localhost successfully, in the same command prompt window where I start the SVN service. After I close the command prompt and tried again, it worked. The commands I used are:

set SVN_EDITOR=c:\windows\system32\notepad.exe
svn mkdir svn://localhost/myproject

Categories
401k and Personal Finance Career Life

2012 Year in Review

Reading Time: 3 minutes

I took this cue from Kurby Turner, the independent Mac/iOS developer, as I think it might be helpful to reflect a year’s work, life, effort, etc. As the old Chinese saying goes “Ji Wang Kai Lai” (learn from past, and look forward to the future).

New job: Software Development
Today is my one year anniversary at my new employer. Looking back, from the initial ramp up to more comfortable work on my own pace, and then deliver the first iOS (iPad) app to the field, back end work, report work and support. I feel good about my effort and the support I got from my coworkers. Sometimes my wife will ask me “why it took so long for you to complete a project”? Because it’s not trivial to do it.

I also wrote a few blog posts on iOS app development, and the back end (.Net) web service. I plan to do the same as times goes. Generally speaking, now I have more confidence doing customized app development, full life cycle, and from front to back end (all tiers).

Family
Our daughter goes to the Hope Montessori Infant Toddler Community at Creve Coeur (off Manson road, near Olive Blvd). We are truly blessed with the teachers and staffs at the Hope family (I consider them as family, both adults and children, because sometimes they are better than family 🙂 . Serenity (Yoyo) learned English and all kinds of things there, which laid a good foundation for her future. For us, we learned parenting lessons there. Sometimes I wonder how much quality time I spent there, from afternoon pickup, to field trip, to social (work-day, Fettuccine, Montessori and Vino, the FMV movie). We watched the FMV movie with great fun, my wife and my friends (couple) did not attend the FMV event, and really enjoyed the movie after I showed them.

Trips
We did one family vacation, and I had 2 business trips in year 2012. We went to Orange Beach, Alabama in the Memorial Day weekend, with Chinese friends. We drove there. It’s funny Yoyo would not go to bathroom on the road, she wants to use bathroom in the hotel or condo (destination). For the business trip, I visited 2 mines in West Virginia, the 2 hours I spent in underground mine is both interesting and a bit unsettling. That’s the first time I visited mines (both surface and underground). In November I visited Las Vegas, stayed in Palazzo (Venetian), which I stayed 3 years ago when I attended AU (Autodesk University, the developer/user conference) in 2009.

Personal Finance
As I wrote this post, I found I made both good moves and bad moves on this topic. I did well in 401k accounts (because I did nothing). But not in the Scottrade brokerage and IRA accounts (because I tried to do too much). Overall I still did ok, because majority of my assets are in 401k (both existing accounts and new account).

Today (01-03-2012) as I listened to Charlie Ellis on the Consuelo WealthTrack podcast, I can not agree more on one comment from Charlie: we all strive to be above average in school or at work. In investing being average is actually not too bad. I understand what meant: 80% of mutual funds perform below average (the index), hedge fund and individual investors are not doing better. So in other words, being average is actually in the top 20% 🙂

Categories
iPhone app

Some tips when creating WCF web service for iPad consumption

Reading Time: < 1 minute

Continuation of previous post.

1) WCF get does not like “NULL” column in the query results

2) // note the “id” should match in declaration and method

Categories
iPhone app

Creating WCF web service II

Reading Time: < 1 minute

A continuation of previous post.

1) Visual Studio, publish web service: check destination IIS app
Before the change, the error was “cannot show the content of the folder”.

2) Add this line to the service.cs (service class C# file), to work around/avoid a problem, asp .net compatibility issue. Do something like this:

[ServiceBehavior]
[AspNetCompatibilityRequirements(RequirementsMode=
AspNetCompatibilityRequirementsMode.Allowed)]
class BarService : IHelloContract
{
// …
}

Refer to wenlong

3) Bad request: it appears to be a class rename problem, Visual Studio has a “red” warning sign, follow it and accept “update”, rebuild.