MessageUI for watchOS - objective-c

I am have an app and in the iPhone app, we use MessageUI Framework, but when I try to add it to my Apple Watch Extension InterfaceController.h file like so:
#import <MessageUI/MessageUI.h>
I get this error:
'MessageUI/MessageUI.h' file not found
Does watchOS not support MessageUI ? and do I have readd the framework again?

WatchOS 2 does not support many of the standard frameworks found on iOS (including MessageUI). If you wish to do something more intensive that requires the need of frameworks available only on iOS, then you can use watch connectivity.
I asked this question a while ago, about a different framework, but the same idea applies: How to reference non-supported frameworks in Watch OS 2

Related

MacOS - UIKit/UIKit.h not found

Try to
#import <UIKit/UIKit.h>
And get error:
UIKit/UIKit.h file not found
What is it and how fix it ?))) Try to import Foundation - all ok )
Originally for macOS you could only use AppKit as an UI framwork, which is quite different from UIKit, so you couldn't reuse iOS code for macOS.
So you have to learn a much different framerwork with NSView base view instead of UIView and a lot of differences.
But then apple supported porting iOS apps to macOS. To do this you need to create an iOS app(if you don't have one) and turn on that option in the settings. Check out more at Running Your iOS Apps on macOS
You would still need to do a lot a work in making your app for macOS comfortable for users, but if you have no background in AppKit, probably it's still easier to go for UIKit

How do you utilize a third-party iOS SDK with your Appcelerator Titanium app?

We have a well established iOS (iPad only) app written on top of Appcelerator's Titanium platform. We're looking to integrate a third-party piece of hardware with our app that interfaces with the headphone jack on the iPad. The third-party company provides an official iOS SDK to be used in XCode projects.
How can we get the provided SDK to work in our Titanium app?
You'll have to create a module. Check the guide here.
You can also search the internet. There might be existing modules already for your third-party SDK.

Cannot test the social framework on a device lower than IOS6

I am working with the social framework. On iPads with IOS6 it works fine.
But when I test it on a device with IOS 5 I get the following error.
dyld: Library not loaded: /System/Library/Frameworks/Social.framework/Social
Referenced from: /var/mobile/Applications/3A3020E0-09D7-49DD-96E2-2E0F20C098D2/RacingGenk.app/RacingGenk
Reason: image not found
Can anybody help ?
Kind regards.
Stef
The social framework isn't available before iOS 6, which explains the problems you're having.
What you need to do is weak link the social framework, which will let you use it on iOS 6 but won't cause pre iOS 6 devices to try to load it. To weak link a library you should select your application's target in XCode, go to the Build Phases tab, and under Link Binary with Libraries make sure that the 'Social.framework' entry is set to Optional rather than Required.
The social framework was introduced in iOS 6, but if you want you have sharing ability for facebook, twitter and many other social networks / sites on devices running versions of iOS before 6.0 then feel free to explore sharekit:
http://getsharekit.com/
Its really easy to use and works for both iOS 6 apps and apps running on previous versions of iOS.
That is because the Facebook integration is only available on iOS6. You can however still use facebook using the original Facebook API for < IOS6 devices.

Twitter integration in iOS 4 & 5 App

I am currently working on app which is supposed to have Twitter integration. The app should also be built so it can be used on iOS 4.3 devices. We'd like to use the built in Twitter Framework on iOS 5 and possibly drop twitter support for iOS 4 devices (not sure about that yet).
The question is: Is this possible? As far as I can tell I can only link statically on iOS builds, which would mean an App built with the Twitter framework can not be run on an iOS 4 device. If this is possible, how would I got about linking the Twitter framework so I can get the app running on iOS 5 with built in Twitter support and ignore the Framework on iOS 4.
It is possible. Apple has introduced weak linking of frameworks that are not supported on older versions. You can get more details regarding weak linking here.
See one more similar question regarding weak linking here.
Hope this solves your problem.

Building a backwards compatible OS X app, when a new API is present?

I'm trying to upgrade an app (Clarke) to provide 10.6 compatibility.
My plan is to use two different code paths depending on the version of OSX in use.
On 10.5 it will use one controller, which consists of completely custom code that isn't dependent on any specific Cocoa API. On 10.6 it will use another controller, which wraps the new CoreLocation API in an identical interface, based on the same abstract class. At runtime the app will switch between the controllers by detecting the OS version.
This works fine on 10.6 built for the 10.6 SDK, but the same build blows up on 10.5 with:
10/09/2009 18:30:50 [0x0-0x12f12f].uk.co.tomtaylor.Clarke[4575] dyld: unknown required load command 0x80000022
10/09/2009 18:30:51 com.apple.launchd[403] ([0x0-0x12f12f].uk.co.tomtaylor.Clarke[4575]) Exited abnormally: Trace/BPT trap
If I build for 10.5 SDK it can't compile the CoreLocation stuff, obviously.
I'd hoped to be able to provide a single binary for this application. Is there a way to 'hide' the CoreLocation API from 10.5?
The Deployment SDK trick works only when you have the same framework on both platforms but new calls in the newer one. For CoreLocation, the entire framework is missing on 10.5, so your app will fail to load because it cannot dynamically bind to the framework.
You need to do the above, plus add CoreLocation as a weak framework. Select your Link Frameworks and Binaries build phase, find CoreLocation in the Detail view, and in the middle column change "Required" to "Weak".
When you build your app, Xcode will pass -weak_framework CoreLocation to the linker, and your app will load on all 10.5 and 10.6 systems regardless of whether CoreLocation is present. It's up to you to make sure not to call any CoreLocation methods unless you are actually running on 10.6, though.
You should be able to solve this problem by changing the build settings of your target:
Set the Base SDK to 10.6
Set the Deployment SDK to 10.5