BuySellAds.com

Read the chapters in my new book Barcodes with iOS 7 as I hand them in. Great new app opportunities await!
Our DNA is written in Objective-C
Jump

MyAppSales – Quick Fix

On the very first day of my vacation Apple updated the iTunes Connect site breaking all existing report downloaders.

My hero is Lukas Matablewski who figured out the necessary changes. Stefan Sorin Nicolin, who is hosting the MyAppSales svn repo commited the changes to the trunk. So please update your working copy now.

All of this while I am in a beautiful NO SIGNAL region of Austria…

Out of Office

I’m out of office while I am on summer vacation with my wife catching up on some honeymooning. I will be back mid August.

Huegel

Until then I will only be able to sporadically check my e-mails and/or respond.

If you have donated for MyAppSales: after the PayPal payment you see a link that takes you back to drobnik.com where you can read the instructions on how to get it. If you missed that then e-mail me, but it will take a while until I respond.

If you have donated for AntiCrack is: Please be patient, I’ll mail it to you as quickly as I get a chance.

All other questions: Please ask them again mid of August when I am back in office.

Crashed MacBook Gets New Lease of Life

I previously reported on the unfortunate encounter of my first MacBook Pro with stone floor. Those alu guys are sturdy little bastards I can now say from experience because it continued to work flawlessly.

Then came my birthday and a new unibody MacBook Pro to replace it. This is two unibody generations newer. This one has an SD-Card slot, dual GPU, 2.8 GHz and 500 GB Harddisk. No SSD yet because for me 128 GB turned out to be too small and larger quantities are not yet financially viable.

Almost as long as I had the old MBP I also had provided a MacMini to my partner Christian whose been learning to code Cocoa on it. Turns out besides of being a Photoshop guru Christian also is well equipped with all screw drivers there are and with the patience and precision necessary to refurbish devices which are usually considered to be “beyond repair”.

Read more

Can Retro Survive the App Store?

Many of the typical iPhone users of today can remember the infancy of video games. First we went to arcades to play simple games made up of sprites or vectors. Many coins went into the slots that allowed you to play. Later companies like Nintendo started to make “Game&Watch” games which you could take with you. Their technical basis would always be an LCD screen where otherwise translucent areas would be made black opaque by electronics to manifest game characters. Movement would consist of several such on/off graphics switched in succession.

The iPhone and iPod Touch devices from today have orders of magnitude more computational power and for a modern game to be successful it has to feature fancy graphics, action and 3D. Or does it? I had a look at two games that like to be correlated to the “Retro” category while at the same time claiming to add “a new twist”. I was intrigued by such a bold statement and thus I am reviewing both apps in this article.

Have a look at those two candidate games and let me know if you think that Retro can be a viable category of games on the store. Or is it the past and should we be glad that it’s over?

Read more

"Are You a Cocoa Crack?" Quiz (1)

These questions will show if you are really the Cocoa Crack you like to believe to be. To see the answer highlight the answer text with your mouse. No peeking! Respond in the comments how many you got correct.

Quiz: Warm Up. Why can you not add an NSInteger to an NSArray? With which extra step can you do it?

Answer: NSInteger is only a different name for a signed integer. It is not a class even though the name might suggest it is. Only instances of classes can be added to NSArrays. The extra step mentioned is to first create an NSNumber object from the integer which you can add to an NSArray.


Quiz: I have an outlet defined and my code compiles without error or warning. But when I try to connect in in Interface Builder it does not show up. Why?

 
@interface CocoaQuizViewController : UIViewController
{
	UILabel IBOutlet *myLabel;
}
 
@property (nonatomic, retain) UILabel IBOutlet *myLabel;
 
@end

Answer: The IBOutlet is at the wrong position. It needs to be before the type UILabel. IBOutlet itself is defined to be replaced with empty text for compiling, that’s why it does not cause a syntax error. But Interface Builder is looking for this keyword in header files to know what outlets there are.


Quiz: What does the following code do? Variable age is defined as NSInteger. Is the syntax correct or is there something missing? It compiles fine, but why does it crash?

myLabel.text = age?[NSString stringWithFormat:@"%@", age]:@"";

Answer: If the variable age is not equal to zero then the result of stringWithFormat will be assigned to the label text. If it is zero then an empty string will be assigned. The format argument is wrong, %@ gets the description of an instance. Since age is probably a number the format argument needs to be %d. It crashes because objC tries to access the memory at position “age” which the app does not own and therefore causes an exception.


Quiz: The following three methods all allow you to connect the outlet in Interface Builder. What is the technical difference between them and which is the method recommended by Apple?

Variant 1:

@interface CocoaQuizViewController : UIViewController
{
	IBOutlet UILabel *myLabel;
}
@end

Variant 2:

@interface CocoaQuizViewController : UIViewController
{
	IBOutlet UILabel *myLabel;
}
 
@property (nonatomic, retain) IBOutlet UILabel *myLabel;
@end

Variant 3:

@interface CocoaQuizViewController : UIViewController
{
	UILabel *myLabel;
}
 
@property (nonatomic, retain) IBOutlet UILabel *myLabel;
@end

Answer: Method 3 is the correct one that should be preferred according to Apple. The instance that gets loaded from the XIB gets retained, just in case which prevents accidental unloading in case of low memory. Method 2 has a superfluous IBOutlet next to the instance variable because in this case the compiler will use the property anyway. Method 1 also can be connected, but it does not retain the loaded instance. This might cause problems if the instance gets deallocated for some reason.


Quiz: Complete this code so that it becomes syntactically correct using no more than one additional word and two square brackets.

NSInteger myNumber = @"1000";

Answer: @”1000″ is in itself a NSString instance. Therefore you can use it as receiver for the method integerValue. NSInteger myNumber = [@"1000" integerValue];


Quiz: (Bonus Question) Why does the following code crash as soon as the property is set? What is the simple fix?

MeasureStripView.h

@interface MeasureLinealView : UIView
{
	NSUInteger minValue;
}
 
@property (nonatomic, assign) NSUInteger minValue;

MeasureStripView.m

#import "MeasureStripView.h"
 
@implementation MeasureStripView
 
@synthesize minValue;
 
 
#pragma mark Passthrough Properties
- (void) setMinValue:(NSUInteger)aVal
{
	// this overriding is absolutely necessary
	self.minValue = aVal;
}

Some other file

MeasureStripView *myMS;  // assume it is properly initialized and otherwise working
myMS.minValue = 100;   // this line crashes. If commented out the app works fine

Answer: Using self.minValue as an lvalue cases the setter method setMinValue to be called. This causes an endless loop running out of memory eventually. The fix is to remove the “self.” inside the setter because minValue is an instance variable and thus accessible just by it’s name throughout the class.

So how many did you catch? Be honest! If you also have a Cocoa riddle like these to contribute please mail them directly to me (oliver@drobnik.com) and I will publish them in this format.

Boosting Your Sales Rank

Michael Dorn of Applyzer.com has posted info on an interesting experiment he performed. The goal was to see how a massive outlet of promo codes would be able to affect the sales rank. While such a practise surely might get frowned about by big Apple, it is commonplace amongst smaller development groups and individuals to trying to increase overall sales.

Chart

The times mentioned on this chart (Games/Trivia US) are central European time zone and document the last 13 hours. You can clearly see the jump in sales rank 11 hours ago with a steady movement toward the “visible sweetspot”.

Read more

Visit WWDC '09 … Retroactively!

Most of the world sees the annual WWDC as one of several fixed occasions where new and exciting stuff is announced or released. But the meat of this Worldwide Developer’s Conference (as the name suggests) is about training.

Being able to attend the WWDC is the dream of many new iPhone developers, as the numbers have shown. 60% of the total 5200 attendees to this years WWDC have never been to the conference before. But attending is expensive. Besides of travel and hotel expenses the ticket alone costs in the vicinity of $2000. Who can really afford to spend a month’s salary on this conference sacrificing a week of vacation time in tandem?

When I got Apple’s notification two days ago that the session videos are now available for sale my heart jumped and my brain got fuzzy thinking whether I should take the plunge and spend $299 for just the iPhone stream or $499 for both iPhone and Mac.  So finally after checking my savings and finding several excuses for spending the money like “It’s training and that’s priceless” I spend 429 Euros on the complete package.

Read more

Your Own Delegation Protocol

Usage of delegates is prevalent throughout the SDK’s that Apple provides. A delegate is basically a way to tell a standard object “Hey you, if you need some info or want to inform somebody when something happens, talk to this guy. I’m outta here”.

This achieves three things that are an essential skills in programming:

  • you make use of a component without having to do extra work of subclassing it for customization
  • you appoint somebody else to do the work of one-the-fly customizing (the delegate)
  • you can excuse yourself and go to the pool

A good example of usage of delegates is UITableView. This standard class, to be found in UIKit, knows and speaks two protocols: UITableViewDataSource and UITableViewDelegate. As the names suggest the first deals with questions related to the content of the table to be displayed: number of sections, number of rows, headers, individual row cells et cetera. The second delegate, which is also called delegate, deals with interactions on a higher level, like if you tapped on an individual cell. Even though they are called different, both are delegation protocols and if you like you can assign discrete classes to data source and delegate for a table view.

To make this a practical example I will show how to make a class that informs your code when a headset is plugged in or plugged out.

Read more

Charitable Coding

When his son Roel was diagnosed with Autism 3 years ago, his father (also named Roel) researched possibilities to help him improve the quality of his life and discovered Righteous Pups Australia. This organization trains Autism Assistance Dogs (AAD) which are especially trained to help increase self-esteem, independence and overall well-being of the autistic dog owner.

As we know in IT, training costs money and those dogs need lots of it. About 29.000 AU$ to be exact. That’s approximately the price of 10 luxury MacBook Pros… kind of puts my own financial challenges into a different perspective.

OzSlangNow Roel has published his first app, an Australian slang dictionary dubbed OzSlang. This is a fun and essential tool for everyone who likes to brush up his OZ Slang skills to not stick out like “such a tourist” or to generally sound more like “Crocodile Dundee”.

I think you can see that the maker put a lot of love into it, it is very well made. Roel tells me that 100% of his proceeds (minus Apple’s cut) go to the above mentioned organization so that eventually the cost for a dog for his son can be covered. The details can be found on Paws 4 Roel website.

It was especially disheartening for Roel when he learned that his app had been pirated. The sales dropped and prospects for an AAD for his son deteriorated. Who can now still argue for piracy as a means of getting “trialware”? Very few (if any at all) of the people who download OzSlang from warez sites would eventually contribute to the cause.

In my book you don’t rip off charitable products especially if they are at the lowest price possible. That’s simply bad karma. If you burglarize the donation box, don’t complain if your future projects fail. That’s how karma works.. On the other hand if you want to get karmically ahead or even, it’s as easy as purchasing a copy of this app. :-)

With his next app, which is currently under review by Apple, Roel will try a different approach. Make the app free, but include a charity button. We know that Apple does not like to see money is moving where they don’t get their 30% share. But I’m keeping my fingers that they won’t mind a donation button for charity.

You can do something good by either donating directly, contacting Roel about sponsoring opportunities or purchasing OzSlang via iTunes. If your contribution is a sizable one I will throw in an hour’s worth of iPhone Development consulting for free to be used any way you like. Good Karma anyone?

Which OS Version to Target?

Now that OS 3.0 has been released and we know that the 3.1 bugfix release is on rails we have to re-evaluate the question which platforms we need to be able to support. On the one hand it might be nice to use all the new 3.0 bells and whistles. One the other hand though this could mean we risk losing half of our potential customers who are still on “old software”.

Besides simple disinterest or negligence the main reason for sticking with old software is that people are always waiting to hear from the iPhone Dev Team that a new version can be jailbroken and sim-unlocked. If you are using your iPhone in the network of your own choosing, you would not want to give this up even for the greatest new update.

From the developer’s point of view there are a couple of features (even before version 3.0) where you had to bump up the minimum OS version. I for one implemented the CLLocation properties course and speed in iFR Cockpit which only became available as of 2.2.

Just today Applyzer released an analysis of the required OS version for all apps on the store. Also AdMob frequently publishes metrics on OS versions in use. Let’s check those to get some guidance for our own apps.

Read more