Xamarin.iOS: Failed to load output manifest for ibtool: Unrecognized property list format

You might get this error after copy/pasting an element in the (Visual Studio) design view (Storyboard). For example copying a label from one view controller to another. If that is the case just hit CTRL-Z to undo the changes. If you for some reason closed the storyboard before building the project (thus before having the error) it is a bit trickier to fix. You have to open storyboard in XML view, search the changes and undo them manually.

Apparently copy/pasting storyboard elements is a big NO NO.

Prevent TouchesCancelled event?

So I am working on a small app where I have overridden the TouchesMoved event. The problem is that the event fires only a few times before it gets cancelled. There might be some UI elements in my view that interrupt the touch processing or this might be expected behavior. Of that I am not sure but here is a small piece of code to show you how to prevent the TouchesCancelled event being invoked.

public override void TouchesMoved(NSSet touches, UIEvent evt)
{
    base.TouchesMoved(touches, evt);
    var touch = touches.AnyObject as UITouch;

    if (touch != null)
    {
        if (touch.GestureRecognizers.Any())
        {
            touch.GestureRecognizers[0].CancelsTouchesInView = false;
        }
        // Do something
    }
}

Xamarin.iOS: NSUnknownKeyException

I was struggling with this exception for quite some time. It was especially puzzling because it happened only on the device. In simulator all was good. Here is the exception:

Foundation.MonoTouchException: Objective-C exception thrown.  Name: NSUnknownKeyException Reason: [<BlueButton 0x14e9f760> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key Label.

So how did I solve this? First of all BlueButton is a custom class extending UIButton with some custom properties like so:

private String _label;
[Export("Label"), Browsable(true)]
public String Label
{
    get { return _label; }
    set
    {
        _label = LanguageHelper.String(value).ToUpper();
        SetTitle(_label, UIControlState.Normal);
    }
}

All good so far but at some point I decided to get rid of the property and replace it with another. This is what caused the problem. Although everything seemed to be alright this attribute definition was still laying around in the Storyboard xml.

 <userDefinedRuntimeAttributes>
    <userDefinedRuntimeAttribute type="boolean" keyPath="Enabled" value="YES"/>
    <userDefinedRuntimeAttribute type="string" keyPath="Label" value="cvbc"/>
    <userDefinedRuntimeAttribute type="string" keyPath="Title" value="Submit and share"/>
 </userDefinedRuntimeAttributes>

Continue reading

Dreamweaver CS4 crashes on startup (another solution)

dw

So if you are experiencing this problem with Dreamweaver here’s a few good places to start troubleshooting:

I struggled with this problem for about a month. I found a lot of “solutions” but none of them worked for me. Boy was I frustrated.

I also contacted adobe support with no luck. Here’s the mail:

“This problem started about a month ago. Until then it worked just fine. When I try to start DW it loads just fine until “initializin files”. Then it just freezes and comes unresponsive. I have even tried uninstalling and reinstalling but the problem remains the same. I am totally lost. I have tried everything including this http://forums.adobe.com/thread/417116. No luck so far.”

Finally I found a solution. For me removing the “configuration” folder was not enough. I had to remove the “Sites” from Windows registry to get Dreamweaver working again. So here is what I did (Windows XP):

  1. Press Windows Button + R (Start menu -> Run)
  2. Type “regedit” and hit enter
  3. navigate to “HKEY_CURRENT_USER\Software\Adobe\Common\10\Sites” and remove it and all of its contents (it will be recreated when you start DW again, but notice that all “Sites” data will be lost. No files will be deleted though.)
  4. Your done

Continue reading

3D Sliding Puzzle Game in Flex

puzzle

The Tech Labs just published my 3D Sliding Puzzle tutorial.

“Flash Platform is a great tool to create games, either for internet or mobile content. With the introduction of Flash 3D Engines, the ability and success of creating flash games is even bigger. In this tutorial we are going to build up a simple sliding puzzle. Puzzle images are dynamically loaded and sliced so you can easily use your own images if you like. Learn, try and leave a comment showing your results.”

If you’re interested in making a simple interactive puzzle game with Flex go check the tutorial :). Have fun.

A* pathfinding

astar21

Path-finding is really an interesting topic and luckily there is loads of information available on the Internet. Implementing the algorithm, however,  is a different thing. Don’t get me wrong. The algorithm itself is pretty easy to digest. Making it fast and efficient is a bit harder. That would involve advanced data structures,  some pre calculations and probably more. Anyway, here’s what I managed to put together. It uses Vector class so FP10 is needed.

Notes about the settings

Map mode:
In this mode you can modify the tiles. White tile equals to “walkable“. Click on a tile to toggle its state.

Path mode:
In this mode you can select the starting and ending points of the path.

Use Manhattan method:
Manhattan method is a fast (thus more inaccurate) method for calculating the distance  between two points. It is the total number of squares moved horizontally and vertically to reach the target square from the current square, ignoring diagonal movement and any obstacles that may be in the way. If this option is unchecked Euclidean Method will be used instead. It is slower but better.

Continue reading

Brain Man (Papervision3D)

brainman2

Don’t ask me about the name / post title :).

Here is demo I made at Talvi Digital a few weeks ago. I got the idea from Audis microsite.

I guess there a few ways you can do this but here’s my solution. I did this demo by reading the models geometry (vertices) into an array. Then I mapped the points to the corresponding positions in 3D space and added the “avoid mouse” behavior. You can do pretty impressive effects with this technique.