Currently Being ModeratedApr 11, 2013 10:32 PM (in response to AceNeerav)
as per mentioned in the tutoria, upon reading it carefully, I simply deleted "-framework Foundation" and compiled it again. It worked.
i was also not adding -arc affter -fobjc
Currently Being ModeratedApr 11, 2013 10:40 PM (in response to AceNeerav)
The message says that the compiler can not find the Foundation framework. You may know that Foundation is the the most important framework, which no Object-C code can execute without it.
I am not sure why this has happened, as I have never seen such error. Foundation is the basis of Cocoa and no doubt that exists on your system. But why your compiler can not find it?
I have not worked with Clang. But there must be some settings for the compiler in use, to determine the path of the Cocoa libraries and frameworks.
Help this helps you
Mani Ghasemnia Hamedani
Currently Being ModeratedApr 11, 2013 11:30 PM (in response to Mani Hamedani)
the book just mentions that depending on the clang verison , the command might not recognize the -foundation commang line option. so it just says to delete it if this error comes. i did and it worked.
Currently Being ModeratedApr 12, 2013 7:29 AM (in response to AceNeerav)
Don't waste your time with that junk. If you want to learn app development, learn it the right way with Xcode. There are good uses for command line tools, but not with Objective-C.
Currently Being ModeratedApr 12, 2013 7:53 AM (in response to AceNeerav)
If the book you are using is Programming in Objective-C by Kochan be aware that the newest edition of the book is the 5th and that there have been changes to Objective-C on the Mac since the earlier editions.
Specifically garbage collection and memory management as well as instance variable declarations.
The command line compile should be
clang -fobjc-arc main.m -o prog
But as etresoft wrote just dive into Xcode you're going to need to learn it at some point. Once you get use to it you'll find it is a great development environment
Currently Being ModeratedApr 12, 2013 9:09 AM (in response to etresoft)
I like to get core understanding.
Currently Being ModeratedApr 12, 2013 9:10 AM (in response to Frank Caggiano)
I have the 4th edition. Is that a lot different?
I am already super confused about variables in obj c!?
Currently Being ModeratedApr 12, 2013 11:33 AM (in response to AceNeerav)
That's fine if you are learning the basics of C. Anything involving Objective-C is going to need a whole lot of extra stuff that isn't worth doing yourself on the command line. You can spend years of your life on a rabbit hole of useless knowledge, but other people who are just getting started need to know a more efficient path to understanding and productivity.