Archive for September, 2011

【iPhone App Dev】Extend NSString with “IndexOf” method

Wednesday, September 7th, 2011

The NSString object in Objective-C is not powerful enough to handle every case, so I plan to extend more methods by myself. The first is a “indexOf” method, it’s just like the method in Java did. I wrote a category to extend original NSString object. Here the code is…

ExtendNSString.h:

#import <Foundation/Foundation.h>

@interface NSString (util)

- (int) indexOf:(NSString *)text;

@end

ExtendNSStriing.m:

#import "ExtendNSString.h"

@implementation NSString (util)

- (int) indexOf:(NSString *)text {
    NSRange range = [self rangeOfString:text];
    if ( range.length > 0 ) {
        return range.location;
    } else {
        return -1;
    }
}

@end

【iPhone App Dev】How to archive your application in Xcode 4.x?

Tuesday, September 6th, 2011

Refence: Apple Tech Doc

1. From the Scheme pop-up menu, choose a scheme.
2. From the same menu, choose Edit Active Scheme to display the scheme dialog.
3. In the left column, select Archive.
4. Choose a build configuration.
5. Specify a name for the archive and click OK.
6. Choose Product > Archive.

An archive is a bundle that includes your product along with symbol information. You can build an archive to seed an application for testing or to validate and submit an application to iTunes Connect.

Your new archive appears in the Archives list in the Organizer window, unless you turn off this option. Each archive is identified in the archives organizer with the date and time it was created. For more information, see the related article on the archives organizer.