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
"shoppingListArray = %@", shoppingListArray]; " warning: unused variable 'stringToOutput' "
[sender setTitle
"Clicked"];
[sender setEnabled:NO];
}
-(float)generateValue
float *)originalValue
{
float radius = [textField floatValue];
*originalValue = radius;
float circumference = [MathUtilities circumferenceFromRadius:radius];
return circumference;
}
@end
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
{
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
[sender setTitle
[sender setEnabled:NO];
}
-(float)generateValue
{
float radius = [textField floatValue];
*originalValue = radius;
float circumference = [MathUtilities circumferenceFromRadius:radius];
return circumference;
}
@end