Ok I am trying to create a simple TableView app that when the row is selected, transitions to a WebView. 我正在使用故事板,并且确实正确连接了我的链接。我收到如下错误。我一直在关注 Lynda.com 的教程和appcoda.com的教程,两者都使用了我在下面尝试过的方法,即使用“指南”或任何他们的 NSObject 类的标题。我真的很困惑和困惑,因为我无法弄清楚为什么它不会识别它。我试过删除@property (nonatomic, strong) Guide *html; 部分,但仍然收到相同的消息。我希望这对你来说足够具体。哦,我正在使用最新版本的 xcode。
我的错误信息是
-[Guide isEqualToString:]: unrecognized selector sent to instance 0x8543aa0
2013-05-05 11:33:29.076 hikingHelp[5522:c07] *** Terminating app due to uncaught exception NSInvalidArgumentException', reason: '-[Guide isEqualToString:]: unrecognized selector
sent to instance 0x8543aa0'
*** First throw call stack:
我的 Guide.h 文件如下:
#import <Foundation/Foundation.h>
#import "TableViewController.h"
#import "DetailViewController.h"
#import "MapViewController.h"
@interface Guide : NSObject
@property (nonatomic, strong) NSString *htmlListName;
@property (nonatomic, strong) NSString *htmlFileName;
@end
我的 TableViewController.h:
#import <UIKit/UIKit.h>
#import "Guide.h"
@interface TableViewController : UITableViewController
{
NSMutableArray *htmlFiles;
}
@property (nonatomic, strong) Guide *html;
@end
我的 TableViewController.m 在 -(void)viewDidLoad:
- (void)viewDidLoad
{
[super viewDidLoad];
htmlFiles = [[NSMutableArray alloc] init];
Guide *html = [[Guide alloc] init];
[html setHtmlListName:@"Survival Planning"];
[html setHtmlFileName:@"survivalplanning.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Survival Kits"];
[html setHtmlFileName:@"survivalkits.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Basic Survivl Medicine"];
[html setHtmlFileName:@"basichealth.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Shelters"];
[html setHtmlFileName:@"shelters.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Water Procurement"];
[html setHtmlFileName:@"waterprocurement.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Firecraft"];
[html setHtmlFileName:@"firecraft.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Food"];
[html setHtmlFileName:@"food.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Edible Plants"];
[html setHtmlFileName:@"edibleplant.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Posionous Plants"];
[html setHtmlFileName:@"posionousplants.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Dangerous Animals"];
[html setHtmlFileName:@"dangerousanimals.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Water Crossing"];
[html setHtmlFileName:@"watercrossings.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Find Directions"];
[html setHtmlFileName:@"directions.html"];
[htmlFiles addObject:html];
html = [[Guide alloc] init];
[html setHtmlListName:@"Signaling Techniques"];
[html setHtmlFileName:@"signaling.html"];
[htmlFiles addObject:html];