我修复了所有警告,现在我的AppDelegate类
中出现了这样的错误.h文件
#import <UIKit/UIKit.h>
@interface UYLAppDelegate : UIResponder <UIApplicationDelegate>{
}
@property (retain, nonatomic) IBOutlet UIWindow *window;
@property (retain, nonatomic) IBOutlet UISplitViewController *splitViewController;
@end
.m文件是
#import "UYLAppDelegate.h"
#import "UYLMasterViewController.h"
#import "UYLDetailViewController.h"
#import <QuartzCore/QuartzCore.h>
@implementation UYLAppDelegate
@synthesize window = _window;
@synthesize splitViewController = _splitViewController;
- (void)dealloc
{
[_window release];
[_splitViewController release];
[super dealloc];
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
UIView *rootView = [[self.splitViewController.viewControllers objectAtIndex:0] view];
rootView.layer.borderWidth = 1.0f;
rootView.layer.cornerRadius =5.0f;
rootView.layer.shadowOpacity = 0.8f;
rootView.layer.shadowOffset = CGSizeMake(-5, 0);
self.window.rootViewController = self.splitViewController; //error here
[self.window makeKeyAndVisible];
return YES;
}
@end
在这一行我犯了一个错误
self.window.rootViewController = self.splitViewController; //error here
SplitViewController由2个控制器组成,.h文件为:
#import <UIKit/UIKit.h>
@class UYLDetailViewController;
@interface UYLMasterViewController : UITableViewController
@property (retain, nonatomic) IBOutlet UYLDetailViewController *detailViewController;
@end
和第二个
#import <UIKit/UIKit.h>
#import "UYLModalViewController.h"
@class UYLMasterViewController;
@interface UYLDetailViewController : UIViewController <UYLModalViewControllerDelegate>{
UIBarButtonItem *_MessageButton;
NSInteger modalViewShowType;
}
-(IBAction)buttonTapped:(id)sender;
@property (retain, nonatomic, getter=_MessageButton) IBOutlet UIBarButtonItem *someMessageButton;
@property (retain, nonatomic) NSNumber *detailItem;
@property (retain, nonatomic) IBOutlet UIToolbar *toolbar;
@property (retain, nonatomic) IBOutlet UILabel *detailTitle;
@property (retain, nonatomic) IBOutlet UILabel *detailDescriptionLabel;
@property (assign, nonatomic) BOOL masterIsVisible;
@end
编辑: 我在控制台中看到了所有内容
GNU gdb 6.3.50-20050815 (Apple version gdb-1708) (Mon Aug 15 16:03:10 UTC 2011)
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-apple-darwin".sharedlibrary apply-load-rules all
Attaching to process 8217.
Pending breakpoint 1 - ""UYLDetailViewController.m":117" resolved
Pending breakpoint 2 - ""UYLModalViewController.m":30" resolved
Pending breakpoint 3 - ""UYLModalViewController.m":41" resolved
Pending breakpoint 4 - ""UYLDetailViewController.m":63" resolved
Pending breakpoint 5 - ""UYLMasterViewController.m":46" resolved
Pending breakpoint 7 - ""UYLDetailViewController.m":36" resolved
No breakpoint number 7.
Current language: auto; currently objective-c
请帮我理解=(
答案 0 :(得分:0)
我大部分时间都有一些SIGABRT
错误,这只是意味着找不到你所指的那个实例。所以再看看那行,并想一想可能没有被宣布的权利。
我认为如果你改成它可能会有所帮助。
self.window.rootViewController = splitViewController;