Thursday, September 10, 2009

Mobclix library 2.x not working in iPhone simulator 3.x

Ok, brief post (just for the sake of sharing my knowledge about this on the internetz).

I recently incorporated Mobclix into my iPhone app. Since I wanted it to work with both iPhone OS 2.x and 3.x, I chose the 2.x version of the Mobclix library. However, I noticed that when running this in the 3.x simulator, the whole application would freeze. After trying to solve this in numerous different ways, I gave up and contacted Mobclix support. This is what I wrote:



[...]

I would be extremely happy if you could take a look at the code I've uploaded here (it is a small Xcode project that is very simple):

http://boomie.se/upload/mobclix%20test3.zip

This is what has been troubling my mind. If I run this on the iPhone simulator 2.x, it works just fine. However, if I run it on iPhone simulator 3.x, the app will freeze.

In this app, I've got a UILabel and a NSTimer that updates the UILabel every second. When running the application in 2.x, you can see the UILabel getting an updated text every second, but in 3.x however, the text wont update at all. There is one line that causes this, and that is:

banner.delegate = self;

in mobclix_test3AppDelegate at line #26.

If you comment out this line, the app will work in both simulator 2.x and 3.x.

Why is this? I need my app to work in both versions, but I also need to be have a delegate to know when the user has tapped the bannner ad.

[...]




And this was the reply I got:


Hi Andreas,

This is Max from Mobclix Support. I've taken a look at your code and I think I've found the solution. Looking at your project it looks like you've integrated our mobclix library for iPhone OS 2.0+. Unfortunately due to changes in the simulator 3.0 sdk our 2.0+ library will not work on the simulator set to run the 3.0 sdk. However the library runs fine on the actual device running 3.0. If you just build to your 3.0 device instead of the simulator you can see the label updates normally. If you have any other questions / problems please do not hesitate to contact support at: support at mobclix dot com.




Hope this has helped someone...