XCode question
-
Hi guys, I'm not in the wrong place - this isn't a request for help... it's just a question to XCode developers out there. If you were in an interview, without access to the internet or any reference manualls, would you be able to convert the following C# code into Objective-C ?
DateTime dt = new DateTime(2014, 12, 25); // It's Christmas !!
int nextYear = dt.Year + 1; // Calculate which year starts next week..I know, it's dumb. I'm just interested in knowing how many of you could program that in XCode, off the top of your heads. I've been working with XCode for almost two years, and my reaction to that problem would be to reach for Google. And I'm not alone. 22,000+ readers have read the following CodeProject article, and if I was given this task, that number would increase by one. iPhone OS: How do I create an NSDate for a specific date? And extracting the Year from an NSDate variable ? Same thing again. I'd need to ask Google's help. And don't even get me starting on mistakenly comparing two NSDates using the less-than or greater-than symbol (it'll actually compare the two pointers, rather than the dates..) I just wonder why Apple doesn't, at some point, just try to make their existing SDK a little more.. finished, rather than adding 4,000 new SDK functions to the forthcoming iOS 8. UIViews ? Let me set just the height value (yes, yes, I know I can write a category function to write this code myself) And so on. Mike Frustrated (and reluctant) XCode developer
-
Hi guys, I'm not in the wrong place - this isn't a request for help... it's just a question to XCode developers out there. If you were in an interview, without access to the internet or any reference manualls, would you be able to convert the following C# code into Objective-C ?
DateTime dt = new DateTime(2014, 12, 25); // It's Christmas !!
int nextYear = dt.Year + 1; // Calculate which year starts next week..I know, it's dumb. I'm just interested in knowing how many of you could program that in XCode, off the top of your heads. I've been working with XCode for almost two years, and my reaction to that problem would be to reach for Google. And I'm not alone. 22,000+ readers have read the following CodeProject article, and if I was given this task, that number would increase by one. iPhone OS: How do I create an NSDate for a specific date? And extracting the Year from an NSDate variable ? Same thing again. I'd need to ask Google's help. And don't even get me starting on mistakenly comparing two NSDates using the less-than or greater-than symbol (it'll actually compare the two pointers, rather than the dates..) I just wonder why Apple doesn't, at some point, just try to make their existing SDK a little more.. finished, rather than adding 4,000 new SDK functions to the forthcoming iOS 8. UIViews ? Let me set just the height value (yes, yes, I know I can write a category function to write this code myself) And so on. Mike Frustrated (and reluctant) XCode developer
Asking this kind of question makes sense if you are to write a highly classified application where you can not have privilege to access network (yes, it sounds absurd but that's only reason I can think of). Still, you can have access to basic help material that usually comes along with IDEs and frameworks. I would simply say I can't do it without even trying. My reason, stupid one, is that I may make a trivial and irreparable mistake. May be interviewer will ignore that if at least the approach is correct. May be he wouldn't. I would probably ask about the development environment I will be working on after saying I can't so this.
My CP workspace: Incredibly trivial and probably useless code samples[^]
-
Hi guys, I'm not in the wrong place - this isn't a request for help... it's just a question to XCode developers out there. If you were in an interview, without access to the internet or any reference manualls, would you be able to convert the following C# code into Objective-C ?
DateTime dt = new DateTime(2014, 12, 25); // It's Christmas !!
int nextYear = dt.Year + 1; // Calculate which year starts next week..I know, it's dumb. I'm just interested in knowing how many of you could program that in XCode, off the top of your heads. I've been working with XCode for almost two years, and my reaction to that problem would be to reach for Google. And I'm not alone. 22,000+ readers have read the following CodeProject article, and if I was given this task, that number would increase by one. iPhone OS: How do I create an NSDate for a specific date? And extracting the Year from an NSDate variable ? Same thing again. I'd need to ask Google's help. And don't even get me starting on mistakenly comparing two NSDates using the less-than or greater-than symbol (it'll actually compare the two pointers, rather than the dates..) I just wonder why Apple doesn't, at some point, just try to make their existing SDK a little more.. finished, rather than adding 4,000 new SDK functions to the forthcoming iOS 8. UIViews ? Let me set just the height value (yes, yes, I know I can write a category function to write this code myself) And so on. Mike Frustrated (and reluctant) XCode developer
It's probably easier with Swift. Just guessing here, as I haven't used either.
Regards, Nish
Latest article: Using the Microsoft Azure Storage Client Library for C++ Blog: voidnish.wordpress.com
-
Hi guys, I'm not in the wrong place - this isn't a request for help... it's just a question to XCode developers out there. If you were in an interview, without access to the internet or any reference manualls, would you be able to convert the following C# code into Objective-C ?
DateTime dt = new DateTime(2014, 12, 25); // It's Christmas !!
int nextYear = dt.Year + 1; // Calculate which year starts next week..I know, it's dumb. I'm just interested in knowing how many of you could program that in XCode, off the top of your heads. I've been working with XCode for almost two years, and my reaction to that problem would be to reach for Google. And I'm not alone. 22,000+ readers have read the following CodeProject article, and if I was given this task, that number would increase by one. iPhone OS: How do I create an NSDate for a specific date? And extracting the Year from an NSDate variable ? Same thing again. I'd need to ask Google's help. And don't even get me starting on mistakenly comparing two NSDates using the less-than or greater-than symbol (it'll actually compare the two pointers, rather than the dates..) I just wonder why Apple doesn't, at some point, just try to make their existing SDK a little more.. finished, rather than adding 4,000 new SDK functions to the forthcoming iOS 8. UIViews ? Let me set just the height value (yes, yes, I know I can write a category function to write this code myself) And so on. Mike Frustrated (and reluctant) XCode developer
People still program for Apple systems? What is this, 1985? :-D
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels) -
People still program for Apple systems? What is this, 1985? :-D
Proud to have finally moved to the A-Ark. Which one are you in?
Author of the Guardians Saga (Sci-Fi/Fantasy novels)Just folks who are interested in making money. Remember, Apple and Samsung make over 95% of the profits in the cell phone industry - and Apple makes the majority of that. It's not market share that's important, it's what you take home.
According to my calculations, I should be able to retire about 5 years after I die.
-
Just folks who are interested in making money. Remember, Apple and Samsung make over 95% of the profits in the cell phone industry - and Apple makes the majority of that. It's not market share that's important, it's what you take home.
According to my calculations, I should be able to retire about 5 years after I die.
Frank Alviani wrote:
what you take home
Yes, and making lots of money will help you with that. :cool:
You'll never get very far if all you do is follow instructions.
-
Hi guys, I'm not in the wrong place - this isn't a request for help... it's just a question to XCode developers out there. If you were in an interview, without access to the internet or any reference manualls, would you be able to convert the following C# code into Objective-C ?
DateTime dt = new DateTime(2014, 12, 25); // It's Christmas !!
int nextYear = dt.Year + 1; // Calculate which year starts next week..I know, it's dumb. I'm just interested in knowing how many of you could program that in XCode, off the top of your heads. I've been working with XCode for almost two years, and my reaction to that problem would be to reach for Google. And I'm not alone. 22,000+ readers have read the following CodeProject article, and if I was given this task, that number would increase by one. iPhone OS: How do I create an NSDate for a specific date? And extracting the Year from an NSDate variable ? Same thing again. I'd need to ask Google's help. And don't even get me starting on mistakenly comparing two NSDates using the less-than or greater-than symbol (it'll actually compare the two pointers, rather than the dates..) I just wonder why Apple doesn't, at some point, just try to make their existing SDK a little more.. finished, rather than adding 4,000 new SDK functions to the forthcoming iOS 8. UIViews ? Let me set just the height value (yes, yes, I know I can write a category function to write this code myself) And so on. Mike Frustrated (and reluctant) XCode developer
MikeGledhill wrote:
I'm just interested in knowing how many of you could program that in XCode, off the top of your heads
Not me, but frankly I couldn't come up with the C# version either without googling, and I spent a few years with C# as the primary language.
-
Hi guys, I'm not in the wrong place - this isn't a request for help... it's just a question to XCode developers out there. If you were in an interview, without access to the internet or any reference manualls, would you be able to convert the following C# code into Objective-C ?
DateTime dt = new DateTime(2014, 12, 25); // It's Christmas !!
int nextYear = dt.Year + 1; // Calculate which year starts next week..I know, it's dumb. I'm just interested in knowing how many of you could program that in XCode, off the top of your heads. I've been working with XCode for almost two years, and my reaction to that problem would be to reach for Google. And I'm not alone. 22,000+ readers have read the following CodeProject article, and if I was given this task, that number would increase by one. iPhone OS: How do I create an NSDate for a specific date? And extracting the Year from an NSDate variable ? Same thing again. I'd need to ask Google's help. And don't even get me starting on mistakenly comparing two NSDates using the less-than or greater-than symbol (it'll actually compare the two pointers, rather than the dates..) I just wonder why Apple doesn't, at some point, just try to make their existing SDK a little more.. finished, rather than adding 4,000 new SDK functions to the forthcoming iOS 8. UIViews ? Let me set just the height value (yes, yes, I know I can write a category function to write this code myself) And so on. Mike Frustrated (and reluctant) XCode developer
without google and without my gists I would probably be stumbling with Intellisense.
-
Hi guys, I'm not in the wrong place - this isn't a request for help... it's just a question to XCode developers out there. If you were in an interview, without access to the internet or any reference manualls, would you be able to convert the following C# code into Objective-C ?
DateTime dt = new DateTime(2014, 12, 25); // It's Christmas !!
int nextYear = dt.Year + 1; // Calculate which year starts next week..I know, it's dumb. I'm just interested in knowing how many of you could program that in XCode, off the top of your heads. I've been working with XCode for almost two years, and my reaction to that problem would be to reach for Google. And I'm not alone. 22,000+ readers have read the following CodeProject article, and if I was given this task, that number would increase by one. iPhone OS: How do I create an NSDate for a specific date? And extracting the Year from an NSDate variable ? Same thing again. I'd need to ask Google's help. And don't even get me starting on mistakenly comparing two NSDates using the less-than or greater-than symbol (it'll actually compare the two pointers, rather than the dates..) I just wonder why Apple doesn't, at some point, just try to make their existing SDK a little more.. finished, rather than adding 4,000 new SDK functions to the forthcoming iOS 8. UIViews ? Let me set just the height value (yes, yes, I know I can write a category function to write this code myself) And so on. Mike Frustrated (and reluctant) XCode developer
maybe start out with... NSDate * newDate = [[NSDate alloc] initWithDate:@"12/25/2014"]; [newDate setYear:[newDate year] + 1]; stuck at work right now so don't have my mac to verify this. I wonder if there is ObjC fiddle web site??