I'm just getting started in the world of Cocoa and Obj C and I'm stuck on a component. Aaron Hillegrass' book is helping me through, but my app keeps breaking. I learned C at university, and dabble with other languages here and there, so that helps, but the problem I'm having right now is comparing the first character of 2 strings. I think it has to do with the data types.
What my goal for this piece of code, is to take a number (06 or 10, for example) and remove the leading zero if it has one. Maybe I'm missing a simple function, but here's what I have so far.
What my goal for this piece of code, is to take a number (06 or 10, for example) and remove the leading zero if it has one. Maybe I'm missing a simple function, but here's what I have so far.
Code:
fileseason = @"06";
firstchars = [NSString stringWithFormat:@"%d", [fileeason substringToIndex:1]];
if (firstchars == 0)
fileseason = [fileeason substringFromIndex:1];