1
這是我的協議未聲明的標識符viewForZoomingInScrollView
#import <UIKit/UIKit.h>
#import "HypnosisterView.h"
@interface HypnosisterAppDelegate : UIResponder <UIApplicationDelegate,UIScrollViewDelegate>
{
HypnosisterView *view;
}
@property (strong, nonatomic) UIWindow *window;
@end
這甚至是在確認協議給錯誤未聲明的標識符viewForZoomingInScrollView之後執行委託
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
CGRect screenRect = [[self window]bounds];
UIScrollView *scrollView = [[UIScrollView alloc]initWithFrame:screenRect];
[scrollView setMaximumZoomScale:1.0];
[scrollView setMaximumZoomScale:5.0];
[scrollView setDelegate:self];
[[self window]addSubview:scrollView];
CGRect bigRect = screenRect;
view = [[HypnosisterView alloc]initWithFrame:screenRect];
[scrollView addSubview:view];
- (UIView *)viewForZoomingInScrollView:(UIScrollView *)scrollView
{
return view;
}
[scrollView setContentSize:bigRect.size];
BOOL success = [view becomeFirstResponder];
if (success) {
NSLog(@"HypnosisView became the first responder");
}else{
NSLog(@"Couldn't become first responder");
}
self.window.backgroundColor = [UIColor whiteColor];
[self.window makeKeyAndVisible];
return YES;
}
的。 我已經從蘋果文檔複製此方法,並通過跳轉到該代表的定義進行交叉驗證。 它顯示未申報多數民衆贊成爲什麼不出現在自動暗示也。 請幫我一把。 謝謝。