Kind of Back, but with IRC & #monotouch

October 12, 2010

If you aren’t in the irc.gnome.org #monotouch chatroom, then you’re missing out. Massively.

I’m at a stumbling block right now, and have been for about 3 weeks now. I spent half of that on other work and the other half muddling around in a spaghetti mess of rainbow colored unicorn feces.

So, at one point there, I finally got into the IRC #monotouch channel, as I’d exhausted pretty much every avenue I could find. (There may be an answer out there, but when you’re dealing with a relatively small pool, those results get lost in Google.) And y’know what? IRC has turned out to be pretty helpful there.

No details for now. But I’ll post back on the topic once I have thing solved. There’s no point in posting until then.


Solved: ldr 12-bit displacement out of range

September 30, 2010

Actually, solved again. The error pops up in a few places. One solution is to restart Xcode or to clean the solution and build again. However, it also pops up in MonoTouch inside MonoDevelop, which makes it hard to restart Xcode. ;)

Try this (Don’t link assemblies):

  1. Double-click the project to open the options.
  2. Click iPhone Build.
  3. Under Linker behavior choose “Don’t link”.
  4. Compile again.

That solves the problem when you are using an external library with gcc_flags to import the external library. i.e. It won’t link and will puke out some bizarre error that has no meaning. Here’s an error I received:

ld: ldr 12-bit displacement out of range (5332 max +/-4096) in 
_AudioServicesPlaySystemSound$stub in _AudioServicesPlaySystemSound$stub

_AudioServicesPlaySyste3mSound has no relevance or bearing on anything. Likely it’s just the point where the linking went wrong, i.e. where the 5332 is over the maximum of 4096.


String Enum Patterns in Cocoa & MonoTouch

September 29, 2010

Well I’m finally starting to see some patterns. Instead of looking for something like “AVFileTypeQuickTimeMovie”, I need to look for things like “MonoTouch.AVFoundation.AVFileType.QuickTimeMovie”. Note where the dot is between “AVFileType” and “QuickTimeMovie”.

Here’s some Apple documentation for AVFoundation constants. You may need to be logged in to see it.

Anyways, here’s the MonoTouch AVAssetExportSession.OutputFileType docs. Note this:

public virtual string OutputFileType  { set; get; }

It’s a property and takes a string. So, recall the Apple docs and this:

AVFileTypeQuickTimeMovie

The actual value is “com.apple.quicktime-movie”. The constant though cannot be used in MonoTouch as there are no “constants” in the same sense/way/manner as there are in Objective-C. Instead, you need to use an AVFileType enum, which is a string, which corresponds to one of the correct values, like “com.apple.quicktime-movie”.

The Objective-C way appears to be somewhat messy coming from C#. But the way Objective-C uses constants is analogous to how C# uses enums. Enums just seem to be neater and tidier than a jumble of constants. But once I see how things work there, it finally starts to make sense.

Anyways, to assign the OutputFileType to an AVAssetExportSession (export), any of the following are ok:

export.OutputFileType = "com.apple.quicktime-movie";
export.OutputFileType = MonoTouch.AVFoundation.AVFileType.QuickTimeMovie;
export.OutputFileType = AVFileType.QuickTimeMovie;

I hope that clears up some confusion for someone. It’s pretty trivial once you know it.

http://developer.apple.com/library/ios/#documentation/AVFoundation/Reference/AVFoundation_Constants/Reference/reference.htmlH


Ditching Xcode for MonoTouch

September 26, 2010

Here’s an interesting post about a dev shop ditching Xcode for MonoTouch. Guess why? Productivity. Xcode simply wastes their time.

I’ve been using .NET since v1.0, and for good reason. It’s productive. It lets you get things done rather than make you fart around doing stupid, time wasting nonsense.


MonoTouch Snippets at Shrinkrays.net

September 25, 2010

I found another cool resource for MonoTouch development here. The author, Chris, has a lot of other things including some MonoDroid materials as well. But his list of MonoTouch tips and code snippets is lengthy and definitely worth checking out.

And, he’s also compiled a short list of other MonoTouch resources that I’m totally ripping here:

The *’d ones I’d already found and have found them very useful. The -’d ones I’ve found interesting, but less useful. Check those out, but check them out after the others.

Normally, I find Stackoverflow is a godsend, but for MonoTouch materials, it falls short right now compared to what you’ll find elsewhere. Still useful, but not as useful as you’d find for normal Windows-based C# development questions.

The MonoTouch forums are really too low volume at the moment. They just don’t have enough people posting there right now. Specifically for answering people’s questions. I expect that’s because MonoTouch is relatively new. I’m quite sure the team at Novell has their hands full and just don’t have the time to spend in the forums baby-sitting all the newbies like me.

Anyways, I’ll post back with more MonoTouch resources later.


mtouch failed with no output (1) – Useless Error

September 23, 2010

Well, having gone through about 30 trillion sample projects, and gotten this error about 60 trillion times, I have come to the conclusion that it is utterly useless.

Actually, it didn’t take me that long to catch on. Still, it feels like that many.

So… What to do?

Go to the project setting page > iPhone Build > Extra arguments > and add in “-v” for “verbose”. You’ll get slightly more meaningful errors. At the moment, I’m still trying to track down what is going on there. I’m getting the errors in the Wrox book “Professional iPhone Programming with MonoTouch and .NET/C#” and with Miguel de Icaza’s sample code on GitHub. So… There’s obviously something funky going on. I’ve tried different SDK versions and different iOS versions to no avail.

In any event… Back to slogging away…


Back to MonoTouch!

September 15, 2010

Well, I’m done my MMORPG work now, and getting back onto my iMac to do some more iPhone programming in MonoTouch!

AND… Get this… I’m looking forward to it!

I’ve found some resources that really make it a lot easier and more enjoyable. I’ll be posting more of those as I use them or whenever I have time or think of it.

But really, the additional resources I’ve found have helped me improve my otherwise horrendous attitude.

This is post #4 in a row with NO profanity! I’m proud of myself~!


UITabBarController in MonoTouch

September 13, 2010

I just found an excellent video on the UITabBarController for MonoTouch here.

He’s also got a good template to create Table View Controllers quickly.

For anyone coming from Visual Studio, the Lamborghini of IDEs, this will be very useful. He goes through things step by step and doesn’t skip things. This is important because a LOT of tutorials out there skip all the most important steps for .NET developers coming from Visual Studio. There are a lot of things in MonoTouch, Xcode, and Cocoa and CocoaTouch that are radically different than the way things get done in the normal C#/.NET/Visual Studio world.

I’ve gone through a lot of materials, and there’s a real weakness out there when it comes to explaining how to have multiple views/windows/frames/dialogs or whatever you want to call them. (Different development backgrounds use “window” and “frame” to mean specific things that may or may not be applicable in the iPhone world.)

I’m still looking for more information on the general topic, and will post back with any good references I find.


iPhone OS Version Changes in MonoDevelop

September 13, 2010

There’s no point in writing iPhone OS v3.0 or v3.2 software if you can do v4.0 with it’s additional features. However, if you’re still in the learning stages like me, then you’ll run into problems trying to run code samples.

To get things fixed, just change the iPhone OS version and SDK version in MonoDevelop.

  1. Right-click on the solution in solution view.
  2. Choose Options.
  3. Under Build, choose iPhone Build.
  4. Under the SDK version dropdown, choose 4.0.
  5. Under the Minimum OS vesion dropdown, choose 4.0.
  6. Click OK and save the solution.

Done.

A lot of examples are written for 3.0, and if you’re new, then it’s likely that you don’t have that SDK installed, and nothing will compile. Changing the SDK version and the OS version will fix that.


Follow

Get every new post delivered to your Inbox.