SplitViewController presentedWithGesture workaround - best solution? - ios

Working on a weird setup where my main development machine is running Snow Leopard (and thus, just has iOS 5.0 SDK) and also have a laptop running Lion (and 5.1SDK). Wish I had a simple solution to be able to develop 5.1 on the Snow Leopard machine, but that's a side issue.
I'm learning UISplitViewControllers, and wanted to have a swipe gesture to change what's being shown in the detail view controller. Implemented that, but in 5.1, there's a property called presentsWithGesture that reveals the masterViewController when you swipe that direction.
You can disable it, but my 5.0 machine gives me an error saying (correct for 5.0) that UISplitViewController doesn't have a property named presentedWithGesture.
Sigh... so I thought I'd test for it, but the following:
if (self.splitViewController.presentedViewController) {
self.splitViewController.presentsWithGesture = NO;
}
... still gives me that error. Is there a clever way to get around this? Some voice in the back of my head says "categories," but I'm unsure where to start.
Thanks in advance for your help.

This is the way to check if theUISplitViewController has the presentsWithGestureProperty:
if ([m_splitVC respondsToSelector:#selector(setPresentsWithGesture:)])
[m_splitVC setPresentsWithGesture:NO];
In iOS 5.1 it will set the property and in previous versions it will not enter the if statement.

You should ask the splitViewController if it can receive the message presentsWithGesture.
if ([splitViewController respondsToSelector:#selector(presentsWithGesture:)]) {
//edited away from dot syntax
[splitViewController setPresentsWithGesture:NO];
}
Keep in mind that this is a code block for working with users who may not be using the same version of iOS that you're linking against. The problem you're having is the opposite, in that you're writing code for the same project on two separate devices, each with a different base SDK.
Edit: see here Is it possible to get the iOS 5.1 SDK for Xcode 4.2 on Snow Leopard?

Related

Reveal.js does not load in ios9.3

My old iPad (ios9.3) refuses to load any reveal.js slides. It only shows the "Fork me on Github" image on the top corner. I suppose it will be that ios 9.3 does not support some new features of html5+js+css (I am not a developer, my skills are quite limited, so please excuse me if I say something stupid).
I am very interested in using it on an iPad due to the chalkboard plugin.
Any of you know what can be causing the trouble? Could I disable any of these features/files and make it work?
Thank you.
aimar
During all this weekend I was trying to figure out a solution. Finally, I manage to debug iOS safari from my windows laptop following this procedure and found that an "Unexpected identifier" was impeding "chalkboard" plugin to load.
A variable was defined with "let" command that, as I learnt, was not recognized by safari 9. I changed 4 "let"s with 4 "var"s commands in "plugin.js" (chalkboard plugin) and now it works in my old iPad, even with reveal v4.
Now I have another issue with the menus (menu plugin) not showing properly, but I will try also to fix it.

IOS9 webapp orientation issue - Sencha version 1.0

We are using Sencha1.0 for our webapp development. In IOS9 version we are facing the following issues.
On initial page load, the page looks fine. When you try to change the device orientation to landscape and back to portrait, all images icons and texts are resized(small).
We tried -webkit-transform : rotate(-90); its doesnt work.
Please suggest the cause and any solution for this.
Sencha Touch 1.1.1 is really quite old version of the framework.
And there is a lot of bug fixes already applied to the framework. The new version of the mobile OS often break a thing or two. You will be also probably seeing an issue on Android devices which runs Chrome 43+
If you already have an App finished and this is the only problem you see, you might fix this by applying override. ( You can check the newer version of the framework and took the part which fixes the issue ) - but it might be really hard to find. Also you probably can't even reach to Sencha support, as the Touch 1 is no longer supported.
But if you are developing the new App, best option for you is to upgrade to Touch 2.4.2
The major release of Sencha Touch should be free to download.
I know that this won't fix the issue but by answer is too long for a comment.

Xcode Beta 6.3 magically delegates tasks to other threads?

We've came onto this strange bug in our project (I hope it's a bug not just our fault). Let's jump straight into the problem.
Our application is Storyboard based, of course it connects to the external API etc. But we've faced this strange thing that regular implementation of prepareForSegue: and things related to segues automagically delegates things to other threads. Just a small example - when I do NSLog(#"Sample log") in viewDidLoad it doesn't get fired when it should but it gets called in the random time that's why I guessed that something might get delegated to the other-than-main thread. Firstly I thought that the networking layer may cause this because of blocks and so but even when I put direc logs into the application they get called in a random time! We've tried to check the thread in debugger and it shows us thet everything happens in the main thread. Strange, right?
Anyway, my colleagues check this against the different versions of Xcode because on my machine there are bothe 6.2 and 6.3 Beta. When we compile this on a computer with only 6.3 installed everything works properly! Is it possible that 6.3 Beta introduces some changes which handles segues differently than previous versions? Or maybe we should start seeking for the troubles some oher place?

Auto Rotate quit working after upgrading to MonoTouch 6

I made a project with MonoTouch 5. After upgrading to MonoTouch 6 my UIViewControllers are not auto-rotating anymore. These are hosted inside a tabviewcontroller. I get this warning:
ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)' overrides obsolete member `MonoTouch.UIKit.UIViewController.ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)'. Add the Obsolete attribute to ShouldAutorotateToInterfaceOrientation(MonoTouch.UIKit.UIInterfaceOrientation)' (CS0672)
But the method still gets called when I am debugging. The new ShouldAutorotate never gets called. Any ideas? Thanks!
There can be a few reasons. One of them is that you should be (if not already) setting the RootViewController in your AppDelegate (another link here). That was not required before iOS6.
Another one is starting to use the new iOS6 API, without keeping a fallback for earlier iOS versions. That would match your comment, i.e. works on 6.0 but not on 5.1.
Note that since you're still targeting iOS 5.x you can safely ignore the obsolete warnings. iOS 6 introduced new API to handle rotation but it will automagically fallback to the old API to keep compatibility with existing applications.
That also means that if you start using the new (iOS6 only) API then you'll need to handle the old API yourself or rotation won't work with iOS 5.x.
Honestly I think that's a testing nightmare - you're better off letting iOS handle this and keep a single code path to handle rotation. That why I strongly suggest you to keep using the older API until your deployment target minimal version becomes iOS 6.0.
I had the same issue after upgrading and I got the answer to my problem over here. Here is the heart of the problem, quoted from the link:
Application windows are expected to have a root view controller at the end of application launch
So if previously like me you have this in your FinishedLaunching(UIApplication app) method in main.cs:
window.AddSubview(mainVC.View);
Replace it with this:
window.RootViewController = mainVC;
That's it! Happy days! Rotation works again. :) At least it solved the problem for me.
I don't know whether this small thing causing the application to go wrong is Apple's fault or Monotouch/Xamarin's fault, but I think that the Xamarin team should do something about this. Surely this is something that could be detected and corrected at compile time?
Anyway. Hope this information saves other people the hours that this issue has cost me!

using panoramaGL library in ios5 and running HelloPanorama

I've been search around how to setup panoramaGL for a whole day and none of these answers my questions. emm, maybe that's because I am new to ios developing and I start with ios5 with all ARC cool features. I did find a pretty comprehensive guide at http://www.codeproject.com/Articles/60635/Panorama-360-iPod-Touch-iPhone but it's a little bit out of date to me. I cannot follow this guide in xcode 4.3 with ios 5.0 sdk.
Emm, so here is the question, assuming panoramaGL and helloPanorama works perfectly fine in whatever xcode version and sdk version it is created in. Is there a way , without any code modification, I can import the library and using the api along with my app developed in ios5? Of course I don't mind some minor modification and I did dive into those code and comment all the retain or release stuff. but wired errors keep popping up. I really need help here.
If it finally turns out to be impossible to reuse it in ios5.0, I will probably need to write the whole thing line by line with my understand of the complicated panorama algorithm...
Thanks so much for the help!
It seems someone is working on another library based on panoramaGL. Works on IOS 5.
See http://code.google.com/p/tk-panorama/
The new version of PanoramaGL 0.1 r2 was released, please check http://code.google.com/p/panoramagl/. This version runs on iOS >= 4.x and supports Hotspots.
Please check HelloPanoramaGL example

Resources