Showing posts with label iOS4. Show all posts
Showing posts with label iOS4. Show all posts

Friday, April 15, 2011

No New Fonts in iOS 4.3.2 Either

While I still remember... Yes, I checked iOS 4.3.2 update. There are no new fonts, when compared to iPhone or iPad running iOS 4.3 or 4.3.1. Don't have iPad2, but I doubt there's any new fonts in that device alone.

Sometimes no news is the news.

Previously released iOS 4.3 has new Noteworthy font and there is also a complete list of iOS 4.2.1 fonts. I do have locally more complete table of fonts, should make it public.

Got a new feature for my fonts application: autocheck whether there are any new fonts. Invest a day worth of development to save 15 minutes of boring manual work!

Sunday, March 27, 2011

No New Fonts in iOS 4.3.1

Just checked iOS 4.3.1 update. There are no new fonts, when compared to iPhone or iPad running iOS 4.3. Don't have iPad2, but I doubt there's any new fonts in that device alone.

Sometimes no news is the news.

Previously released iOS 4.3 has new Noteworthy font and there is also a complete list of iOS 4.2.1 fonts.

Am I obsessed with fonts? Just a little bit :)

Thursday, March 10, 2011

New font with iOS 4.3

iOS 4.3 was released yesterday evening. Checked the built-in fonts right away and found out that none of the old ones are missing - and that there's a brand new font in both iPhone and iPad: Noteworthy.

Pre-release rumours said it was added for iPad Notes application, replacing Chalkboard SE. Looking at Notes in iOS 4.3 both iPhone and iPad are using Noteworthy.

Sunday, January 16, 2011

How to Check if iOS Supports Class, Method or Keyword

iOS is getting fragmented. More devices to support with major iPhone hardware differences (0-2 cameras, no telephony - 3G - CDMA), screen resolutions (original, double, iPad) and especially more older operating system versions out in the wild.

To reach as many users as possible you have to check whether something exists before you try to use it. Customizing code based on iOS version number is possible, but there are other ways to do it.

Tuesday, December 28, 2010

What to Do with UIRequiresPersistentWiFi

Last night I was watching a streamed TV show (*) from great archives of national broadcasting company. At about 32 minutes it stopped! Couldn't restart the show, couldn't pause and restart, couldn't stop and restart, couldn't restart the application to restart the show.

Application was ok, responsing well. Just wouldn't play anything for me.

Tuesday, November 23, 2010

Xcode 3.2.5 Base SDK Missing

Downloaded Xcode 3.2.5 and iOS SDK 4.2, installed and opened an old project. Got error note Base SDK Missing, as expected. Nothing to worry about!

Select project, press Command-i to view project info, find Build - Architectures - Base SDK and select the new "Latest iOS (currently set to iOS 4.2)". Close info - and nothing happens!

Select Targets and your application, press Command-i to view target info. You might have overwritten default project settings by mistake earlier. Check what is Build - Architectures - Base SDK. Should be same as you just defined for project. Close info - and nothing happens!

Close Xcode, reopen your project - and Base SDK is set! Didn't really expect this kind of new features with the update...

Update: No need to close Xcode, just toggle some settings via "Overview" popup at top left corner. For example change "Active Configuration" to Release and back to Debug. Usually that's enough, though sometimes target device has changed, too. Verify all "Overview" selections after you've done this.

Thursday, October 7, 2010

How to Get Rid of Keyboard with a Tap on Background part2

There was a nice way to remove keyboard by using UITextView, but that has stopped working with iOS4. At least I got such a defect report for beta application. This time I will remove keyboard using UIButton, let's see how long that will work:
- (IBAction)removeKeyboard
{
    [textField1 resignFirstResponder];
    [textField2 resignFirstResponder];
}
Open your view in Interface Builder, create new custom full screen UIButton to cover everything, select UITextFields and UIButtons (etc.) one by one and "Send to Front" via Layout menu. Connect UIButton "Touch Up Inside" to your callback and that's it.

Nice, easy, simple, fast - what more can you ask for!

Tuesday, September 21, 2010

<Error>: CGImageCreateWithImageProvider: invalid image size: 0 x 0

There seems to be a bug in iOS 4.0 built-in MapKit, which causes error message in both simulator and real device:
<Error>: CGImageCreateWithImageProvider: invalid image size: 0 x 0.
This happens when I open UIViewController, which contains MKMapView (all created with Interface Builder). Since user location is not needed at this moment, I just unchecked "Shows User Location" checkbox on Map View Attributes.

Warning disappears and I'm back on Zero Warning policy!

Thursday, July 15, 2010

How to Accept Self-Signed Server Certificate

We have public server, test server and release test server. Likewise I generate three different binaries, each connecting to different server. The problem is that test servers have self-signed certificates and iPhone fails by default in NSURLConnection sendSynchronousRequest. The error note is:

ERROR CODE -1202 = The certificate for this server is invalid. You might be connecting to a server that is pretending to be “xx.xx.xxx.xxx” which could put your confidential information at risk.
The solution with iOS4 is this one line:
#if (defined(TEST_VERSION) || defined(RELEASE_TEST_VERSION))
    [NSURLRequest setAllowsAnyHTTPSCertificate:YES
                                       forHost:[url host]];
#endif
    [NSURLConnection sendSynchronousRequest:request 
                          returningResponse:&response
                                      error:&error];
Please note that the specific line is undocumented class method and thus not used in official release, only for testing with simulator or ad hoc releases.

To remove compiler warning add this at the beginning of your file:
#if (defined(TEST_VERSION) || defined(RELEASE_TEST_VERSION))
@interface NSURLRequest (DummyInterface)
+ (BOOL)allowsAnyHTTPSCertificateForHost:(NSString*)host;
+ (void)setAllowsAnyHTTPSCertificate:(BOOL)allow forHost:(NSString*)host;
@end
#endif
More info at Dr. Touch article: Ignoring Certificate Errors on NSUrlRequest.

iOS5 update: this code might (or maybe not) help a little from my blog article Server API change from HTTP to HTTPS

Tuesday, July 6, 2010

UITextField textFieldShouldBeginEditing called twice in iOS4

When you tap UITextField, you get two textFieldShouldBeginEditing calls. This looks like a bug in initial iOS4 release. Workaround is to use a BOOL flag to decide what you should do with that call:
- (BOOL)textFieldShouldBeginEditing:(UITextField *)textField
{
    if (self.allowEdit)
    {
        [self askUser];
        return NO;
    }
    return YES;
}

- (void)askUser
{
    if (self.alertVisible)
        return;    
    self.alertVisible = YES;
    
    UIAlertView *alert =
    [[UIAlertView alloc] initWithTitle:@"Please verify"
                               message:@"Do you want to edit?"
                              delegate:self
                     cancelButtonTitle:@"Cancel"
                     otherButtonTitles:@"Yes",
     nil];
    [alert show];
    [alert release];
}

- (void)alertView:(UIAlertView *)alertView
    clickedButtonAtIndex:(NSInteger)buttonIndex
{
    self.alertVisible = NO;
    if (buttonIndex == 1)
        [self doSomething];
}
The bug will (should) be fixed in some future iOS4 release, so it's more safe to isolate your work-around inside your own routines as much as possible to minimize possible unwanted side-effects.