2011-04-25 48 views
0

这是什么意思?property'scrollView'需要定义方法'-scrollView' - 使用@synthesize,@dynamic或提供方法实现?

属性'scrollView'需要方法'-scrollView'来定义 - 使用@synthesize,@dynamic还是提供一个方法实现?

它告诉我,在同一行@end

#import <UIKit/UIKit.h> 

@class ViewScrollViewController; 

@interface ViewScrollAppDelegate : NSObject <UIApplicationDelegate> { 
    UIWindow *window; 
    ViewScrollViewController *viewController; 
    UIScrollView *scrollView; 
    UITextView *textView; 
} 

@property (nonatomic, retain) IBOutlet UIWindow *window; 
@property (nonatomic, retain) IBOutlet ViewScrollViewController *viewController; 
@property (nonatomic, retain) IBOutlet UIScrollView *scrollView; 
@property (nonatomic, retain) IBOutlet UITextView *textView; 

@end 

回答

2

你合成的财产?

这样的..

//your .h file... 
@interface myViewController:UIViewController{ 
    ScrollView *scrollView; 
} 
@property(nonatomic,retain)ScrollView *scrollView; 
@end 


//your .m file 

@implementation myViewController 
@synthesize scrollView;  //are you doing this? 

... 
... 
... 
@end 

编辑:基于编辑的问题,提问者的代码片断..

在您.m文件..

@implementation ViewScrollAppDelegate 

@synthesize scrollView,window,viewController,textView; 

//Now your implementation.. 
... 
.. 
@end 
+0

@ Bavarius..thanks编辑..我错过了什么? – Krishnabhadra 2011-04-25 04:37:50

+1

您可以点击'编辑XX分钟前'以直观识别编辑差异。新文本标记为绿色,删除的文本标记为红色。你在'@ synthesize'中忘记了一个分号。 – 2011-04-25 04:46:24

相关问题