OrderDetailsView.h財產申報
#import <UIKit/UIKit.h>
@protocol OrderDetailsViewDelegate;
@interface OrderDetailsView : UIViewController {
IBOutlet UITextView *OrderDetails;
NSString *selectedOrder;
id <OrderDetailsViewDelegate> delegate;
}
@property (nonatomic, assign) id <OrderDetailsViewDelegate> delegate;
- (IBAction)done:(id)sender;
@end
@property (nonatomic, retain) NSString* selectedOrder;
@end
@protocol OrderDetailsViewDelegate
- (void)OrderDetailsViewDidFinish:(OrderDetailsView *)controller;
@end
OrderDetailsView.m
#import "OrderDetailsView.h"
@implementation OrderDetailsView
@synthesize selectedOrder;
@synthesize delegate;
我正在錯誤
財產申報不@interface或@implementation上下文
我想你可能會對@end關鍵字的結尾感到困惑。您使用@end來結束@interface,@protocol或@implementation。因此,在您的示例中,您有@接口,您在{}中聲明變量,然後聲明所有屬性和方法,然後您@end @interface。 @protocol和@implementation也是一樣。 – filipe 2010-10-05 13:41:37