Just learning Objective-C coming from a Java background. I am trying to write a program that has no purpose other then to teach me how to write functions in this language and I am getting errors everywhere. The problem is since I just started with this language yesterday the errors make no sense to me. Here is what I have so far.
Main Method:
int main (int argc, const char * argv[])
{
@autoreleasepool
{
NSString * prompt = @"Hello World";
prompt = writePromptMessage(prompt);
NSLog(@"%@", prompt);
}
return 0;
}
Special Method:
NSString *writePromptMessage(NSString * prompt)
{
return prompt;
}
My Errors:
- Implicit declaration of function writePromptMessage is invalid in C99
- Implicit conversion of 'int' to 'NSString *' is disallowed with ARC
- Incomplete integer to pointer conversion assigning NSString strong from int
- Conflicting Types for writePromptMessage