You are here

iOS

Candy Crush Saga Cheats

I gave in and I tried this Candy Crush game that everyone was talking about. I'm hooked.

Let me be clear. Five lives per day is a perfectly healthy number. It gives you some time for leisure, and then you are forced to assimilate back into society as a contributing member.

That said, I get just as much fun from taking toys apart as from playing with them, so I started tearing it apart to see what I could do about these limited lives.

These are notes, not instructions. A developer should have no problems here, but if you need step-by-step instructions you'll need to look elsewhere. Better yet, just buy some more lives/items.

The Save File

Your belongings in the gave are saved in a save file, called save_XXXXX.dat, where XXXXX is some sort of timestamp. This file is present in the app's sandbox once you have played the game. It is a binary file. If they used a serializer, I'm not sure which one.

For an iOS device you can read and write to the filesystem using DiskAid.

The process for reverse-engineering save files is no mystery. Copy the save file. Make a change. Copy the save file. Compare.

I used VBinDiff for the binary diffs and Fhred as my hex editor.

Here are my findings so far. Values are big-endian.

Item Byte Offset Bits Tested Bits Predicted
Disco ball 0x0050 32 32
Coconut ring 0x0068 16 32
Jelly Fish 0x005c 8 32
Wrapped & Striped 0x00a4 16 32
Lives 0x0290 16 32
Lollipop hammer  0x0074  8 32
Lucky Candy 0x0098  32
       
       

iOS filenames cannot contain more than one period.

It took me a while to figure out why my app couldn't file the file day-icon.20.png. When it renamed it to day-icon.png it worked fine.

System.InvalidOperationException: The operation cannot be completed because a build is already in progress.

Building using Xamarin.iOS and Visual Studio 2012 stopped working for me when my debugging target is a physical device. Clicking Start resulted in the message:

System.InvalidOperationException: The operation cannot be completed because a build is already in progress.

It worked fine at invoking the simulator.

This appears to be a bug, but there is a workaround: Go to the solution's Configuration Manager and uncheck Deploy.

This issue and workaround are present in Xamarin.iOS 1.8.365.

iOS AutoLayout is broken for non-trivial layouts.

A custom control, like the calendar component shown here, requires many subviews. In fact, to generate this view requires about 700 subviews, unless manually user-drawn.

Apple's AutoLayout was introduced in iOS6 to provide a means to layout user interfaces independently of screen size, aspect-ration, and resolution. Unfortunately it is very ineffecient and appears to have an order of O(c^n) i.e. every subview added makes the layout take exponentially longer.

The control that is shown, designed to use AutoLayout, takes up to 10 seconds to render on an iPad. This essentially makes it unusable.

In examining the execution using Instruments I came to the realization that it was all Apple code that was swallowing all this time. Eventually I found two others who came to the same conclusion the hard way:

By turning off AutoLayout, the calendar renders (incorrectly of course) in a fraction of a second. I'll be spending this weekend writing my own MagicLayout code, which will be used by the cross-platform component library that is in development.

Cross-platform user interface development for iOS, Android, and Windows Store

I am currently developing a C# / .NET user interface platform that will finally allow you to write the UI once in C# and create:

  • iOS applications using Xamarin.iOS
  • Android applications using Xamarin for Android
  • Windows Store (WinRT) applications

I will consider adding Windows Phone and Silverlight, which should be easy ports.

The platform will include an attractive and flexible calendar control.

The project will represent about 500 hours of development. The components will be released under commercial license. The target price is $200-300. I hope to release many building blocks of the platform under an open-source permissive license.

The calendar component is currently in alpha release.

If you would like more information, or would like updates as they become available, please contact me.

Xamarin Authorized Consulting Partner badge

Xamarin Consulting Partner badges

Xamarin doesn't have much in the way of graphics for its partners so I made these badges. Other partners may find them useful.

MonoTouch: NSUnknownKeyException - This class is not key value coding-compliant for the key

This error can occur in the constructor of AppDelegate (when it calls base.ctor()).

This occured to me when I have specified the application's entry point in Info.plist in the Main Interface setting.

A similar error will occur any time an outlet exists for a control that no longer exists in Interface Builder.

When your iPhone has hiccups…

Introduction

My softball team thought it would be fun to play intro music for each person as they went up to bat, like some major-league teams. I welded together a portable sound system complete with pneumatic wheels, second-hand shelf speakers, an AGM battery, and a 40W head unit.

I recently purchased a refurbished iPhone 3GS from an online retailer. I needed one for testing an application that I've been hired to build. Since I had the iPhone anyway, I figured the touch interface would work well for our team's sound box.

The Problem

The first problem, I learned, is that the iPhone cannot play a single song, then stop. It always continues on to the next song unless it is the only song in a playlist. Luckily I wasn't the only person who found this extremely stupid, and before reaching for my compiler I checked the App Store and found Benjamin Pung's One track Mind app.

The next problem was that when I plugged in the cord from the headphone jack of the iPhone to the Line In jack of the head unit, there was an annoying beat, beat, beat sound.

For the benefit of those searching, it could also sound like: click, click click; thump, thump, thump; pop, pop, pop; beat, beat beat.

I considered loose connections, impediance mismatch, and EM interference, but I was able to rule those out. Oddly, rebooting the device would make it work normally until I fiddled with the jack (I still haven't figured this out).

It is noteworthy that this symptom is not present when listening with headphones (this is where, I believe, impediance plays a role).

The Solution

Many internet searches informed me that this was a very common problem without a solution.

I notice that pushing the plug into the jack forcefully and holding made the noise stop. I also noticed that when I did so, there was just a little end-play; maybe 0.2mm. I had a hunch.

I grabbed a toothpick and went digging. I scraped the tip of the toothpick against the bottom of the jack repeatedly, and was able to pull out several small pieces of what I'll call lint – probably a mixture of dust, fibres and oil.

I plugged it in to the stereo and ta da! No more noises. No more end-play.

Moral

Once again, the simplest solution (though not necessarily the most obvious one) usually is the correct one.

I'm posting this tip because many people have this problem, and most keywords like click, beat, and pop result in pages of results completely unrelated information (thanks Dr. Dre).

Pages

Simple Copyright Policy: If you want to reproduce anything on this site, get my permission first.