Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Xcode Beginner

macrumors newbie
Original poster
Apr 28, 2010
8
0
Please see string of codes below in blue:

Can anyone help on this? I have been going through some tutorials and just typing codes in as I am asked to do.
However I came to a point where the code is "built and run" but I always get warning messages such as:
" warning: 'NSArray' may not respond to '+arrayWithObjets:' "
" warning: unused variable 'stringToOutput' "

I am using a book titled: (Beginning Mac Programming" (Develop with Objective C and Cocoa) by Tim Isted

Please see below. Any suggestions?

Please note that the sad faces in the code are ":" followed by (.


#import "NotifyingClass.h"
#import "MathUtilities.h"
#import "WonderfulNumber.h"

@implementation NotifyingClass

- (IBAction)displaySomeText:(id)sender
{

NSString *firstObject = @"Milk";
NSString *secondObject = @"Eggs";
NSString *thirdObject = @"Butter";

NSArray *shoppingListArray = [NSArray arrayWithObjets:firstObject, secondObject, thirdObject, nil]; " warning: 'NSArray' may not respond to '+arrayWithObjets:' "
NSString *stringToOutput = [NSString stringWithFormat:mad:"shoppingListArray = %@", shoppingListArray]; " warning: unused variable 'stringToOutput' "
[sender setTitle:mad:"Clicked"];
[sender setEnabled:NO];
}

-(float)generateValue:(float *)originalValue

{

float radius = [textField floatValue];
*originalValue = radius;
float circumference = [MathUtilities circumferenceFromRadius:radius];
return circumference;
}


@end
 
There is nothing wrong with XCode. There is everything wrong with your ability to copy. It's arrayWithObjects: not arrayWithObjets:. I imagine the other issue is the same.

Absolute accuracy is required when programming. Slow down, take more care and read the error messages. The chance of the compiler (which is not XCode by the way) being wrong and you correct are approximately 0.
 
There is nothing wrong with XCode. There is everything wrong with your ability to copy. It's arrayWithObjects: not arrayWithObjets:. I imagine the other issue is the same.

Absolute accuracy is required when programming. Slow down, take more care and read the error messages. The chance of the compiler (which is not XCode by the way) being wrong and you correct are approximately 0.

I am a brand brand brand new student in this and have a lot to learn. Thank you for your help. It seems that you need an eagle's eye to do programming.
once again thank you.
 
There is nothing wrong with XCode. There is everything wrong with your ability to copy. It's arrayWithObjects: not arrayWithObjets:. I imagine the other issue is the same.

Absolute accuracy is required when programming. Slow down, take more care and read the error messages. The chance of the compiler (which is not XCode by the way) being wrong and you correct are approximately 0.

Do you have any suggestions for learning this think. books and any specific useful references for a beginner?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.