UITableViewヘッダーにUIBUttonを追加しましたが、機能していないようです。クリック可能ですが、IBActionをアタッチすると失敗し、何もしません。
私はオンラインで読んで、それをあなたのファイルの所有者に入れるのを見ましたが、それはできません。アクションを入れると、ファーストレスポンダーにのみ表示されます。
また、別のファイルに入れようとしましたが、入れても他のファイルにドラッグできません。
ファイル:
RootViewController.h RootViewController.m TableViewAppDelegate.h TableViewAppDelegate.m DetailViewController.h DetailViewController.m
RootViewController.h
@interface RootViewController : UITableViewController {
NSMutableArray *listOfItems;
Sqlite *database;
NSTimer *myTimer;
UITextView *myTextField;
}
- (IBAction)addAlbum;
RootViewController.m
#import "RootViewController.h"
#import "TableViewAppDelegate.h"
#import "DetailViewController.h"
@implementation RootViewController
// If a user adds a photo album
- (IBAction)addAlbum {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Add Gallery" message:@"this gets covered" delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:@"Ok", nil];
myTextField = [[UITextField alloc] initWithFrame:CGRectMake(12, 45, 260, 25)];
CGAffineTransform myTransform = CGAffineTransformMakeTranslation(0, -80);
[alert setTransform:myTransform];
[myTextField setBackgroundColor:[UIColor whiteColor]];
[alert addSubview:myTextField];
[alert show];
[alert release];
[alert setTag:1];
}
どんな助けでも大歓迎です!ありがとう。