1

何らかの理由で、コードで宣言されたIBActionがファイルの所有者にありません。私はこれを1時間見てきましたが、理解できないようです。

これにはおそらく本当に簡単な説明があります。私はおそらく馬鹿になりそうです。前もって感謝します!

以下は私のコードです。

RootViewController.h

#import <UIKit/UIKit.h>
#import "Sqlite.h"
#import "SecondViewController.h"

@interface RootViewController : UITableViewController {
NSMutableArray *listOfItems;
Sqlite *database;
NSTimer *myTimer;
UITextView *myTextField;

}

- (IBAction)addAlbum;

@property(nonatomic, readonly, retain) UILabel *detailTextLabel;

@end

RootViewController.m

#import "RootViewController.h"
#import "TableViewAppDelegate.h"
#import "DetailViewController.h"

@implementation RootViewController

 // If a user adds a photo album
 - (IBAction)addAlbum {

SecondViewController *screen = [[SecondViewController alloc] initWithNibName:nil bundle:nil];
screen.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:screen animated:YES];
[screen release];

}

それらはファーストレスポンダーに表示されますが、リンクすると機能しません。ありがとう!

編集:これらのアクションを別のXIB(MainWindow.XIB)で使用したいと思います。.hの各ファイルにアクションを追加しようとしましたが、MainWindow.XIBにアクションが表示されません。

4

1 に答える 1

0

RootViewController.hが保存されていることを確認してください。

RootViewController.xibを開き、[ファイルの所有者]を選択します。

[ID]タブでRootViewControllerがクラスとして選択されていることを確認してください。

[接続]タブで、IBActionを確認できるはずです。

于 2011-02-21T03:51:00.030 に答える