Since [AVCaptureVideoPreviewLayer setOrientation] was deprecated in iOS 6, I am trying to use [AVCaptureConnection videoOrientation:AVCaptureVideoOrientationLandscapeLeft]; but I getting an error saying "No visible #interface for 'AVCaptureConnection' declares the selector 'videoOrientation.'" I have been trying to research for a AVCaptureVideo SDK for iOS 6 but I've had no luck. I also tried recreating the AVCaptureConnection but I had no luck in doing that. Here is a web reference to the code I am partially using. http://red-glasses.com/index.php/tutorials/ios4-take-photos-with-live-video-preview-using-avfoundation/
Wow. Boy do I feel stupid [AVCaptureConnection setVideoOrientation:AVCaptureVideoOrientation];
Related
I am adding the iAd framework to an existing application. The application is portrait only and iPhone only. Everything is running in iOS 6, both in the simulator and on an iPhone 5. However, it fails in iOS 5 both in the simulator and on an iPhone 4. It throws the following exception:
'NSInternalInconsistencyException', reason: 'currentContentSize must be one of the requiredContentSizes; 'ADBannerContentSizePortrait' is not in {(
ADBannerContentSizeLandscape
)}'
The exception is thrown on this line:
iAdBannerView.currentContentSizeIdentifier = ADBannerContentSizeIdentifierPortrait;
I see no way of displaying anything other than a landscape banner this way. I'm assuming I must have something configured wrong somewhere, but I don't know where, and find it curious that it works fine in iOS 6.
Any help here is greatly appreciated! Thanks!
UPDATE: I can't answer this because I don't have enough rep points. But I have it fixed:
Background: I'm using the Kobold2D wrapper around ADBannerView. It's class, KKAdBanner, is the one that is actually calling the line causing the error. It turns out, it was preceding this call by configuring ADBannerView to only allow landscape sizes. This was a configuration issue and I can resolve it.
Of course, now I don't know why in the world it ever worked in iOS 6 at all, but oh well :-)
I've never used this, but from what I'm understanding from the documentation you need to set the #property(nonatomic, copy) NSSet *requiredContentSizeIdentifiers
with all the value that currentContentSizeIdentifier could take.
And your exception is saying that in that NSSet you only have the one for the landscape.
The difference you are seeing could be due to a different default values in different iOS version. (I'm guessing)
Reference here.
"Could not instantiate class named UICollectionView" I am new to iOS6 please explain why the above error is coming?
I am getting this error when i trying to convert the StoryBoard project for UIViewCollection
to nib using this example
You are probably running your app with an iOS version below 6.0 - upgrade your device or use the appropriate iOS Simulator version.
I was using ios5 simulator, when i changed the simulator to iOS6 it worked.
It was corrected a long before,forgot to update on stackOverflow.
Thanks for answer anyways.
+1 for user1034669.
My App, which is created for iOS4, is crashing in iOS6 and is not installing on simulator or device.
It just shows the splash screen and crashes.
Did finish Launching is not being called.
Can anybody please Help?
Finally i got the solution of my problem mentioned above.
In my ios4 App, in FirstViewController.xib "Use AutoLayout" was checked.
I just removed the checkmark and my App start working.
Amazing!!!
I would recommend creating a new project, and either carefully looking for the changes in delegate or any deprecated code, or just moving all of your code to the new project. Also, you should run a convert to modern syntax check.
There may be issue with Application Delegate. The obvious reason - your object is not set as an application delegate.
Looking at Apple documentation there is quite a few ways to accomplish it:
Remove application delegate binding in Interface Builder (.xib file
for the window) Set 4th parameter of UIApplicationMain in main.h to
something else than nil.
Check you nib file in Interface Builder and see if the App Delegate is setup.
Or Reference to documentation Core Application Design
Hope this will you out.
Look into the release notes of xcode, ios6
It is said that when working with IOS6, Auto Layout is turned on and that crashes the app if used on older versions. Check the link, which has other things to watch out for:
https://developer.apple.com/library/mac/#releasenotes/DeveloperTools/RN-Xcode/_index.html
https://developer.apple.com/library/ios/#releasenotes/General/RN-iOSSDK-6_0/_index.html
I had these two lines of code that worked in iOS 4. Following an upgrade to iOS 5, it no longer works.
The code would put a background image on the Navigation bar.
CGImage navban = CGImage.FromPNG(new CGDataProvider("images/banner.png"), null, false, CGColorRenderingIntent.Default);
NavigationController.NavigationBar.Layer.Contents = navban;
I am using MonoTouch. Does this no longer work in iOS 5? If so, is there another way to accomplish it?
Thanks.
The property BackgroundImageForBarMetrics of UINavigationBar should do the trick. It's new in ios5 and supports this scenario without going behind UIKit's back.
I'm dealing with a very odd situation. I'm implementing Attributed Strings into my iOS application, and I had the warning going in that they are available iOS 3.2 and above. Because I still support 3.1.3 on iPhones, I knew I had to weakly link CoreText and probably so some compile time OS check before using them.
I weakly linked the framework, but out of curiosity I just used the class as is and ran it on a 3.1.3 device... and it works. What am I missing here, I'm so confused why this isn't crashing. I'm 100% sure this is a 3.1.3 device, but is NSMutableAttributedString a hidden class on 3.1.3, and thus actually does work because of the dynamic nature of objective-c ?
I am the author of the OHAttributedLabel class.
Thanks for using it!
The behavior you have is strange, as OHAttributedLabel uses the CoreText framework to draw the NSAttributedStrings on screen.
As CoreText is only available since iOS 3.2, I can't see how it would be possible for this to work under iOS 3.2, especially iOS 3.1.3…?
Did it really work, instead of just not crashing?
Depending on the setting, a non-existent class becomes just nil. Note that in Objective-C you can send a message to a nil. Then it just returns nil or 0. Then [[NSAttibutedString alloc] init] might just return nil, without crashing.
CoreText was introduced with iOS 3.2. If you weak link against it the app will start, but it will crash on the first instance on calling a CoreText function.
To still be compatible with earlier versions you CAN weak link and avoid CT code by drawing the text with Quartz instead. You would detect if CT exists on the device and use it if yes, otherwise you would have a crude fallback mechanism for your drawing.