Friday, May 30, 2014

Upgrading for iOS 7

Upgraded my app for iOS 7, had to following a few things:
1. Had to add following code to the (void)viewDidLoad method to avoid Views overlapping:
if ([self respondsToSelector:@selector(edgesForExtendedLayout)])
        self.edgesForExtendedLayout = UIRectEdgeNone;
2. Had to change some button type from System to Custom so as to allow the image button work properly.
3. image button on the Navigation Bar also need special care in order to made them work:
    UIImage image=[UIImage imageNamed:@"clock.png"];
    UIButton *customButton = [UIButton buttonWithType:UIButtonTypeCustom];
    [customButton  setFrame:(CGRect){CGPointZero, image.size}];
    [customButton  addTarget:self action:@selector(randomMsg) forControlEvents:UIControlEventTouchUpInside];
    [customButton  setImage:image forState:UIControlStateNormal];
    UIBarButtonItem *barItem = [[UIBarButtonItem alloc] initWithCustomView:customButton ];
    self.navigationItem.rightBarButtonItem = barItem;
    [barItem release];
4. needed to create a dozen or so icon files from various devices, and add them to the Asset Catalog.
5. distribution process also changed, now you can no longer submit to App Store directly from Archive window any more and have to build a .ipa file and use Application Loader to send to App Store
6. Also one of my precious mistakes ignored by the old Interface Builder now is causing the new Interface Builder and Xcode to crash, I somehow had a UILabel inside another UILabel on one of my .XIB file, and this would cause error message like:
ASSERTION FAILURE in /SourceCache/IDEInterfaceBuilder/IDEInterfaceBuilder-5056/InterfaceBuilderKit/Document/IBDocument.m:2578
Details:  An instance of IBUILabel with object ID 13 did not archive its child (IBUILabel) with an object of ID 24.
Removing the nested UILabel stopped the crashing of the Xcode.

Will Apple Approve it? let's keep fingers crossed.

Tuesday, June 25, 2013

Apple Genius or Apple iDiots?

1)Mountain Lion upgrade caused machine to stuck in the installer screen!
2)Took Machine to Apple Store, told have to make appointment!
3)Came back to Apple store for the appointment, waited almost 1 hour to get service! Was told have to leave the device with them.
4)Got call saying need replace HardDrive, rip off alert
5)Got call saying device was ready, came to Apple Store to pick up the device! bring it home, Wi-Fi not working, Bluetooth keyboard not working. i am skrewed royally
Sons of Bitches

Saturday, August 18, 2012

A Few Lessons Learnt Shipping to App Store

My App finally was shipped: http://itunes.apple.com/app/weiqi2go/id543435551?mt=8

Following are lessons I learnt over the final stage:
1) I developer-rejected my submission close to a dozen times for the issues around network reachability, here first you need to be able to detect whether network is available, second you need to be able handle very slow 2G network. and one key point here is you should never use synchronous network calls instead make async calls and always set a time out.
2) Test, test, test and perhaps seek help from profesisonal testers. Ideally write up the functional requirements and/or user guide before testing, they will make tester life easier and helps have all points checked.
3) Prepare videos along the way for marketing the app down the road-as most app review sites such as 148apps requires you to provide videos. I also found shooting such videos is quite helpful to your QA effort. And if you want to put your video on YouTube, remember to limit you video under 100M, YouTube will remove your upload if it is "TOO LONG".
4) Keywords, The English App Store allows 100 character max keywords, you can NOT changed after the app released until you add another version, pick them carefully and make sure all your audience are covered if you got a global audience, at first while I had keyword "baduk"(korean name of Go), I didn't put in its korean spelling "바둑"-I wonder which one Koreans would use to search App Store, best way for sure is to include both keywords so no matter which keyword these international audience use they will always find your app!

P.S. despite I developer-rejected my submissions some 10 times, the time my last submission spent in the 'Wait For Review" queue was 10 days exactly the average, unlike what some people wrote in a blog, saying if you rejected you app many times you will have to wait even longer than normal-that blog article for sure added me some additional stress during my wait.

Friday, July 6, 2012

When you created a distribution provision profile, you need to selected at least ONE device

Apple's provision portal is very misleading on this one, if you do NOT selected any device, NO provision profile will be generated!

Tuesday, July 3, 2012

EXC_BAD_ACCESS error and NSTimer, and invalidate!

For almost 1 day and half I have been troubleshooting an odd situation where after my code that stops a NSTimer object, the application could crash mysteriously.

After combing sands over and over and over, I realized the crash was not in the code where I kill off the timer. Soon after reaching this conclusion I found the cause, and one reason it made it so hard to find this error was that even after you sent "invalidate" to a NSTimer object(according to Apple docs, invalidate remove the timer from run loop also cause the timer to be released!), your timer event handling code STILL could be called!

Why cannot Xcode point us more closely to where in the code the exception or "error" occurred?!

Friday, June 22, 2012

A couple iOS implementation tips

First tip, inside UITableView, if you need to change the background of a row, you need to do so inside the willDisplayCell delegate instead of cellForRowAtIndexPath:

Second tip, if you need to organize a group of files inside a subfolder under Resources, make sure you drag the folder from the Finder into Resources inside Xcode, and ALSO make sure you check this option:


Monday, June 18, 2012

To the Device and Beyond?

Just deployed my code to my phone, didn't expect it to work right away but wished to have some pleasant surprises, no, there were issues more than one, and it made me scratching my head wondering.
As you could see on the device the background image for the game board was not rendered as in the simulator, also the image for one of the button was not rendered either........

After digging around, I found the issues:
1)the iPhone simulator is NOT case sensitive but the device is case senitive
2)earlier I used initWithFormat to get the path to the background image, it worked in the simulator but failed on the device, I replaced that with stringByAppendingPathComponent, and now it is working both in the simulator and on the device.