Timm
Timm

Reputation: 2662

MonoTouch/Three20: Add many items to the first page of TTLauncherView

I observed some unexpected behavior with TTLauncherView from Three20.

After creating a standard view like this var launcher = new Three20.TTLauncherView();

If I try to add TTLauncherItemitems like this

launcher.AddItem(item1, false);
launcher.AddItem(item2, false);

it creates a new page for each items.

Reading some Objective-C sample I came across something that would translate like this in C#, but it doesn't work neither, due to a System.MissingMethodException: Method not found: 'MonoTouch.Foundation.NSObject.IsNewRefcountEnabled' at runtime.

var items = NSArray.FromObjects(NSArray.FromObjects (item1, item2));
launcher.Pages = items;

So how would one go about adding many items to the first page of an TTLauncherView with MonoTouch using the official Three20 bindings?

Upvotes: 1

Views: 251

Answers (1)

poupou
poupou

Reputation: 43553

System.MissingMethodException: Method not found: 'MonoTouch.Foundation.NSObject.IsNewRefcountEnabled

This error comes from bindings compiled with MonoTouch 5.1+ where a new refcount mode is available.

If you're using MonoTouch 5.0.x (latest stable) then you'll need to rebuild the Three20 bindings library to use them in your project.

Otherwise you can update to the latest MonoTouch (5.2.1) beta to use the binding binaries you already have. A stable release should be available soon so using the beta for a short term might be easier for you (than rebuilding the bindings).

Upvotes: 1

Related Questions