Frage

I am trying to create an object in the following way:

#import <Foundation/Foundation.h>

@interface Song : NSObject{
    NSString *songID;
    NSString *title;
    NSString *artist:
    NSString *album;
    NSString *length:
    NSString *votes;   
}
@end

I get the error Unexpected interface name 'NSString': expected expression

Could somebody also explain what the difference between adding variables after the interface with a {}? Some code I see uses the brackets others don't (they just the @property method). Or any link to documentation would be great. Thanks!

War es hilfreich?

Lösung

You are using ":" instead of ";" after artist and length.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top