SQLite doesn't even have a proper native date type (see my SO recent post on this topic), and to the extent you can store dates in SQLite, it doesn't make sense in the absence of a year. Not sure it makes sense to have a NSDate without a year, either.
Personally, I'd just store three fields, day, month, and year as separate numeric fields in the database, leaving the year blank if you don't know what year the person was born. Thus, just use a simple NSScanner as suggested by @benzado:
int day;
int month;
int year;
NSScanner *scanner = [NSScanner scannerWithString:birthdayString];
if ([scanner scanInt:&month] &&
[scanner scanString:@"/" intoString:nil] &&
[scanner scanInt:&day])
{
// found valid month/day
if ([scanner scanString:@"/" intoString:nil] &&
[scanner scanInt:&year])
{
// found year too
}
}
Or use NSString's componentsSeparatedByString to get it into an array of strings as suggested by @Jacob:
NSString *monthString, *dayString, *yearString;
NSArray *dateComponents = [birthdayString componentsSeparatedByString:@"/"];
if ([dateComponents count] >= 2)
{
monthString = [dateComponents objectAtIndex:0];
dayString = [dateComponents objectAtIndex:1];
// found month and day
if ([dates count] == 3)
{
yearString = [dateComponents objectAtIndex:2];
// found year, too
}
}