How can I add NSSpeechSynthesizer Class Reference? - iphone

How can i add NSSpeechSynthesizer Class Reference.
I think it is in
/System/Library/Frameworks/AppKit.framework.
However there is no such framework name in framework window when I am clicking add existing frame work.
Can any one help me to do it.

VSSpeechSynthesizer is available for the iOS - but it is a private API and as such will likely be rejected from the app store. However you can still make apps for private consumption. I consider this a bug as it makes creating accessible apps for the partially sighted for instance, harder. I have filed Bug ID #: 9451650 Bug Title: VSSpeechSynthesizer is Private
I currently use Flite TTS in my App. All hopes fix on the Nuance integration in iOS5 being available as a public API.

AppKit framework is MacOS framework, not iOS, and so NSSpeechSynthesizer class is also available on Mac only.
Check this question on SO for the list of some 3rd-party text-to-speach engines available on iPhone

You can find it inside iPhone SDK
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk
/System/Library/PrivateFrameworks/VoiceServices.framework/VoiceServices

Related

Flash iOS applications

I am currently building an iOS application with flash CS5 and I would need some help with a couple of the features:
Is it possible to add in-app purchases? If yes, how does that work?
Is it possible to add iAd advertising to the app? If so, how? If not, is there any good alternative that works with flash?
How can I save data from within the app so it will be there eaten if the user restarts the app and even the device (like for a headboard and such)?
Any help is highly appreciated!!! :D
If it were a few months ago. Then answer would be an unequivocal no. However, presently, the answer is "perhaps" (or if you are an optimist, "probably"). With the release of Air 3.0, it now supports Native Extensions. These extensions are native code that have a wrapper API around them so that they can be compiled in with and called from an Air application.
In fact, I decided to look around real quick while researching for this answer and found a repo where it looks like somebody has implemented in-app purchases via a ANE. But I haven't tested this extension personally, but it may be a good starting point to see how it is implemented.
The reason you wont find too much information about ANE's yet is because they were only recently supported in the Air 3.0 update that happened last month. They are currently unsupported in Flash CS5 (or 5.5) or Flash Builder 4.5. They are supported in Flash Builder 4.6, which is currently in a closed beta. But you might be able to sneak in still, and it should be released soon.
The biggest "drawback" is that these extensions need to be developed in the native format for the device you are targeting. So that means, if you want to make an iOS extension, then you are writing it in Objective-C and xcode on a mac.
Pretty much the same answer as before. It should be possible with a ANE. But I haven't found any examples of anybody doing it yet.
It is very simple to save data/state to the device. You'll want to look into the SharedObject.getLocal() method if you want to the LSO. Or you can just use low-level File writing. Check out File.applicationStorageDirectory. For sensitive information that should be encrypted into into the EncryptedLocalStore class, which I believe is supported on iOS but not on Android.
All of these should provide a good way for you to persist data between application sessions.
With AIR 3 you can now use native extensions to call into the native platform code to achieve the functionality not provided by AIR Actionscript APIs. To answer your questions.
in app purchase. I have a sample at http://code.google.com/p/in-app-purchase-air-ios
iAd. I have a sample at http://code.google.com/p/iad-air-ios/
As others have already answered use local shared objects.

Weak Linking Foundation and UIKit?

I introduced Printing via AirPrint recently, but wanted to not drop support for pre 4.2 versions (obviously). Done it before for things like Game Center, etc. What I found particularly odd in this case was I had to weak link UIKit. Printing was not contained in its own framework allowing me to be more granular.
This just didn't feel right, although it solves my problem allowing the app to run properly on all versions.
In Apple's SDK Compatibility Guide they state:
When using a framework that is
available in your deployment target,
you should require that framework (and
not weakly link it).
UIKit is available, just not classes such as UIPrintInfo, UIPrintInteractionController, etc.
Am I right that it seems odd to weakly link such a core framework? Is there a better way?
There is a better way. iOS 4.2 introduced NS_CLASS_AVAILABLE for this purpose, but there are some restrictions on using it. All the details are listed in the documentation linked to below:
http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/cross_development/Using/using.html

Recommended way to support backward/forward compatibility in iPhone app?

I'm in the early stages of an iPhone app and I have a question. I did some searching but did not find what I was looking for.
There are features in iPhone OS4 that I would like to take advantage of, but I would like for my app to also run on 3.X.
It looks like I want to develop against the 4.0 SDK and do the following:
Create a "weak link" to any new (4.0) frameworks
Call respondsToSelector: for any
new method in an existing framework
or any method in a new framework
before making that call
Am I close? What's recommended?
Pointers to similar questions welcome.
UPDATE:
Just as a note - if you are trying to check for a new framework, you're best chance is to call respondsToSelector: on a class method against the class object instead of using an instance method.
Yes, that's exactly how you do it!
The only other trick I can think of that you have not already mentioned is that you build against the latest SDK (i.e., 4.0 in this case) and set the target to be the earliest you want to support (3.0 in this case).
You might like to try using the 3.2 SDK to create a universal (iPhone/iPad) app. This is an Apple template that uses this same method to work with two different APIs.

ConnectionKit & iPhone SDK

I'm still getting my feet wet with the iPhone SDK, but I'm wondering if it would be possible to get the ConnectionKit framework working for an iPhone app. I know it was developed for the desktop OS, so I'm not sure what sort of dependencies it has and whether or not it could be shoehorned into the iPhone OS.
In my case, I would like to use its FTP functionality, though having access to this entire framework could prove useful for future projects as well.
Any ideas or experience trying this?
In case it helps, here's the official ConnectionKit site: http://opensource.utr-software.com/connection/
The site was a little light on documentation.
The big question is what Cocoa classes it depends on. Since it is doesn't include any UI code, it should be based on Foundation classes. Foundation in Cocoa Touch is similar to, but not exactly the same as on OS X. Just check out what classes it uses.
The other obstacle is building the framework as a static library. Since the iPhone does not support frameworks/dynamic libraries, you have to build a static library to use it in your code.
That should help get you started.
There are two primary issues. One is static library and other is NSHost class that is supported by cocoa - but not cocoa touch. First one is doable - but the second one is doable if and only if you are familiar with Mac OS networking internals.

Using a custom framework

The error I'm getting:
in /Users/robert/Documents/funWithFrameworks/build/Debug-iphonesimulator/funWithFrameworks.framework/funWithFrameworks, can't link with a main executable
Cliff notes:
trying to include framework
doesn't want to link
More detail:
I'm developing for a mobile device... hint, hint using Xcode and I'm trying to make my
own custom framework which I can include from another application. So far, I've done the following:
Create a new project; an iPhone OS window based app.
Go to target info-> under packaging, change the wrapper extension from app to framework
Go to Action->new build phase -> copy headers. Change roles of headers to 'public'
From my application, I add the framework to the frameworks group.
Apple clearly said that you can not use dynamic libraries on their mobiles. And a private framework is just this.
You can, however, use static libraries.
Egil, that's usually considered as one of the implications of section 3.3.2 of the iPhone developer agreement, which (in part) forbids plug-in architectures or other frameworks. The fact that they don't provide an Xcode project template for an iPhone-compatible framework tends to reinforce the idea, though of course it could just be an oversight or something they're discouraging without actually forbidding.
Whether this is the intended meaning of that section is something you'd have to ask Apple about, and possibly consult a lawyer, but this is where the oft-stated "no frameworks" idea comes from.
For those who have framework code they'd like to use in an iPhone app, an alternative approach is to use the framework code to build a static library. That then gets compiled into the application instead of getting dynamically loaded at run time. The fact that it's part of the application executable avoids any potential concerns about this part of the agreement.
Though dynamic libraries are not allowed, you CAN create a framework (using static libraries and lipo).
Check out: http://accu.org/index.php/journals/1594
I haven't tried it for so called mobile device, but I would guess its very similar to the method for a regular Cocoa application. Check out this tutorial:
Embedded Cocoa Frameworks