属性'scrollView'需要定义方法'-scrollView' - 使用@synthesize,@ dynamic或提供方法实现?

时间:2011-04-25 02:56:02

标签: ios cocoa-touch uiscrollview scrollview

这是什么意思?

  

属性'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

1 个答案:

答案 0 :(得分: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

修改:基于askers编辑问题的代码段。

在您的.m文件中..

@implementation ViewScrollAppDelegate

@synthesize scrollView,window,viewController,textView;

//Now your implementation..
...
..
@end