iPhone - UIMessage.framework - sms

In an iPhone application, we are supporting sending text messages. For this we have to integrate UIMessage.framework in the application. This feature is supported only in OS 4.0 or above version. In the implementation, however, I have disabled the feature if the device OS is earlier that 4.0. However, the issue I am facing is that for devices earlier than 4.0, tha package cannot be installed, simply because the framework needs is included in the package.
Is there any work-around for this issue? Is it possible to have a build in such a way that only if the OS is 4.0 or higher, this framework is included while for earlier versions, this is not needed. Or am I missing something here?
Thanks

Set the UIMessage framework to be weak linked in your application's targets. That way, it's conditionally linked at runtime when needed.

Related

Does .Net 5 support any ways to play/make sounds on Mac platform?

I've recently started using .Net 5 on Mac, and I've discovered that Console.Beep throws an 'unsupported operation' exception.
Do the standard libraries provide a working way to make sounds for Mac? I do not believe they did in .Net Core, as per: How to play a sound in NETCore?
TLDR: From further research, I believe the answer is NO.
I discovered the System.Media.SoundPlayer class (which is in .Net 5.0), but I got a compile error System.Media belonged to missing assembly System.Windows.Extensions.
I found and installed this via Nuget: https://www.nuget.org/packages/System.Windows.Extensions/
My application now compiled but upon trying to call SoundPlayer.Play() I got PlatformNotSupportedException -
"System.Windows.Extensions types are not supported on this platform."
I can't see in the documentation anywhere if .Net 6.0 will change this though.

Developing app for 10.8+ but using 10.9 SDK

Mavericks is coming out and for developers that's always a busy time with all these new features and APIs to know about and use. For me, I think it is the perfect time to ask a question that has been bugging me for a very long time.
Here's the thing, in context: I am developing an app that I want to be able to run on 10.8 (so the target system is 10.8+). Right now I am using the 10.8 SDK. However, with the release of 10.9 comes some pretty sweet APIs that I would like to use in my app. I use them in my code, but then, of course, I have to compile my app against the 10.9 SDK. If I do that, can I still run the app on 10.8?
Or, in a more general way, if I compile my app against one SDK, can I still run it on a 'lower' Mac OS? If yes, can you explain how does it work under the hood (what is the compiler doing)? This is a mistery for me.
Generally speaking, Xcode disassociates the issue of the SDK and the Deployment Target of the app.
The SDK is determined by Base SDK, and the deployment target is determined by OS X Deployment Target. These both show up in the Build Settings tab for each target in Xcode.
When programming with different SDK and Target, you are responsible for making sure that you don't call methods or functions on an OS that doesn't have them. This is often facilitated by weak linking (in the case of new frameworks) and/or using -respondsToSelector: in the case of new methods on existing classes and frameworks.
In Xcode, under build settings, there is an option for target OS where you can pick 10.8. 10.8 applications are generally compatible with 10.9 so the compiled application will work with both OSs.
Don't expect the new Apis to work when running on a lower version. It doesn't work that way.

Explicitly set base SDK to 3.2 to catch compiler errors

We're building an iPad app and don't plan to use any APIs that are not available in iOS 3.2. Our deployment target is already set to 3.2, but I would like to set our base SDK to 3.2 so that we get compiler warnings/errors if we accidentally invoke APIs not available in 3.2, rather than runtime failures.
Is this a good idea? If so, is the 3.2 sdk still available for download, and will older sdks work with newer XCode versions, like 4? Thanks.
There's no guarantee Xcode will support older SDK versions but as an example the current install of Xcode 4 goes all the way back to 3.0. I would drop 3.2 if I were you (few iPad users are on that; most iOS apps enforce 4.X in the App Store so I'd bet most people have upgraded) but if you are going to support it perhaps you should consider using conditional code for different OS' versions.

Do I have to compile my iPhone app with 4.2?

I have iPhone application in the App Store. Do I have to compile my app with iOS 4.2 SDK in order to allow it run on iOS 4.2 devices? Or compiling using iOS 4.2 is required only to allow using new features of new iOS?
I will appreciate if you can clarify this issue...
Thanks!
Yoash
Do I have to compile my app with iOS
4.2 SDK in order to allow it run on iOS 4.2 devices?
No, it will run on the new firmare just fine. At least if the new firmare does not reveal some bugs in your code (which happens).
You don't need to recompile it to let it run on newer OS versions, but like you already guessed, you need to recompile it when you want to use the newer features (eg. AirPlay, "Multitasking" etc).
The old version should still run.
The app might not play well with new features like multitasking on iPad, so it is worthwhile trying to get some testing and feedback done as soon as you can in case there are issues.
If you download the XCode 4 pre-release from the developer portal, you can use the new static analyser to look for problems in the code: this is not just for SDK issues but also things like memory leaks.
Apple recommends that you always compile with the latest SDK, even if you are targeting older versions.
Unless you run into a specific issue that is causing incompatibilities, it is wise to take this advice. A lot of small bugs and performance issues are fixed with each new iteration of the SDK.
That being said - you can continue to use the older SDK's, and Apple will still accept the apps you build. For mature apps that are only going through minor tweaks, this is probably the safest course to avoid introducing new bugs.

Debug for iOS 3.x in xcode with SDK 4.1

I've downloaded the latest SDK from developer.apple.com and can only pick 3.2 or 4.1 from Project > Properties > Base SDK.
My iPhone is 4.1
My client have iPhone 3.x
You feel the problem...
How can I debug for iOS 3.x in xcode with the 4.1 SDK installed?
Actually that's a very frequent question (was lazy, only linked one).
Short version: you need to set your Base SDK to the highest SDK version you've got and your project's Deployment Target to the lowest version you like to support, e.g. 3.0. This means, the Deployment Target specifies the oldest version your app should be able to run on. But beware, this setting does not prevent you from accidentially calling, say, methods available since 4.0 on an 3.0 iPhone and thus causing a method missing exception.
This isn't possible have I come to understand.
You have to buy a old iPhone 3.x.
If you want my opinion on this, then I think this is horrible, frustrating and completely not understandable.

Resources