Turning off Spell checker in a iPhone App - iphone

Developing a iPhone application - where I want the 'Spell checker' functionality to be turned off when the application starts, firstly, is this possible? if yes, can someone help me with the code for the same?
Secondly, if this is possible, and what would happen, if the user pauses my application, and goes and starts another application, for instance sending a SMS where by default the iOS turns on the spell checker - when the user would switch back to my app, would the spell checker be turned on then?

Whether or not it’s enabled is a property of the text field, not of your application. It’s specified in the UITextInputTraits protocol; to disable autocorrection on a text field, you’d do this:
[myTextField setAutocorrectionType:UITextAutocorrectionTypeNo];

You can do this by checking out the attributes when you select the UITextField or UITextView options

Related

which multi-selection can be implemented in iphone (Registration page)

I have multi-selection dialog(drop-down) in Android where user selects all options applicable to him in registration page.What can be used in Iphone for the same purpose ?
And selecting a few options will unhide few textfields which is mandatory to fill.
Let me know what can be my approach.Please share any open source code links.
Thanks in advance.
No, there is no such thing within the iOS SDK and that is for a good reason - those elements are just not pretty, funky and usable well enough when acting on a touch display.
Consider using UIPickerView or UISegmentedControl instead. Maybe also have a look at Action Sheet.

How to check spelling entered in textview?

I have one UITextview in which user enter text. after that i take that text as a string and display it in another textview and want the words which are grammatically incorrect.
How to do that?
Use the UITextChecker class that's been available since ios 3.2: Apple Documentation
iOS system only provide spell checking while the user is inputting text. If the user choose to type in the wrong word or words, iOS cannot help. If you want to perform your own spell checking, you will have to include your own spell checking library.
GNU Aspell is a Free and Open Source spell checker designed to eventually replace Ispell. It can either be used as a library or as an independent spell checker.
Aspell Spell Checker on iPhone? was asked a few years ago here on SO. I am not sure if they ever got it working.
Use autocorrectionType property of UITextInputTraits protocol which is implemented by UITextView
#property(nonatomic) UITextAutocorrectionType autocorrectionType
Use it as below
To disable
myTxtview.autocorrectionType = UITextAutocorrectionTypeNo;
To enable
myTxtview.autocorrectionType = UITextAutocorrectionTypeYes;
In Apple Documentation
You can use Correction option under Text Input Traits in TextField Attributes using Interface Builder. It will take care of Valid English words.

Character count in MFMessageComposeViewController

Is there a way of showing the character count in the MFMessageComposeViewController? I have turned it ON in the iPhone settings for the native sms app but in my app it does not show it.
From MFMessageComposeViewController Class Reference :
Important: The message composition interface itself is not customizable and must not be modified by your application.
It's seem that you cannot change anything to this class.
Maybe there is a way to know if the option is enabled on the iPhone and, in this case, you'll put this key in NSUserDefaults but it will be surprising.

iPhone: What is the correct way to leave an Application?

Hallo Everyone,
with the iOS 4, the iPhone is supporting Multitasking, what is very nice, but something I do not wish to support in my Application. I mean, when the user press the Home-button, I want my application to finish and not to enter in Background. With the iOS 4, when the User press the Home-button, the App calls the applicationDidEnterBackground: delegate's method to enter in Background and in order to "force" the Application to finish when the user press the Home button, I've done following implementation:
- (void)applicationDidEnterBackground:(UIApplication *)application {
//save everything...
exit(0);
}
PROBLEM: I've noticed, that exit(0) brings the Application immediately to finish, without calling deallocating methods like "dealloc", and I think that is not a good programming style. So I would like to ask you guys, how to bring the application to finish in a "nicer" way.
Thanks in advance.
What you actually want is not to exit the application (which is as mentioned not allowed), but tell the OS you would rather your application be killed rather than backgrounded.
There is an info.plist key for that, UIApplicationExitsOnSuspend. Set that in your info.plist to TRUE (checked) and then when your app enters the background it will be terminated.
That's two questions:
How to programmatically exit an iPhone app - duplicate
Proper way to exit iPhone application?
How to cause an iPhone app to not go to background in iOS4:
Add the UIApplicationExitsOnSuspend key to your info.plist and set its value to YES
http://developer.apple.com/iphone/library/documentation/General/Reference/InfoPlistKeyReference/Articles/iPhoneOSKeys.html#//apple_ref/doc/uid/TP40009252-SW23
One answer above says "There is an info.plist key for that, UIApplicationExitsOnSuspend. Set that in your info.plist to TRUE (checked) and then when your app enters the background it will be terminated." with Xcode 4, the info.plist value is "Application does not run in background" of type Boolean, so setting this to YES will have the app exit when the user presses the "home" button.
You are not allowed to. I know from experience: got an app rejection from Apple because I've exited (that was two and a half years ago but I doubt they've changed their policy here). There's a "private" (i.e. not mentioned in header file) method "terminate" on UIApplication, IIRC. But Apple says you may not do that. Only thing you can do is to show a dialog, asking the user to press the home button. But in turn doesn't work if on a device with multitasking enabled... so I guess you really have to change your application in such a way that you can throw away your state on applicationDidEnterBackground and start afresh on application on applicationDidBecomeActive.

iPhone app remembers last state (multitasking?) unwanted behavior!

User launches the app, quits, relaunches and the app shows up in the exact previous state, as if the app didn't quit at all. I have no custom save state support, so this is really baffling. It happens on one of the user's 3GS, but not on my 3G. Which seems to indicate that this is OS4's multitasking at work, because 3G isn't supported. If this is true, is there a way to turn off this behavior?
So, if your app isn’t supposed to use multitasking at all or if you simply wish to disable it during development or debugging, all you’ve to do is to edit your project’s info.plist and depending on how you’re editing it:
* Raw text editor
Add a property named “UIApplicationExitsOnSuspend” and set it’s value to ‘Yes’
* The XCode GUI plist editor
Add a new row and select “Application does not run in background” (or type “UIApplicationExitsOnSuspend”) and then toggle the checkbox
http://www.alexandre-gomes.com/?p=545