これはSOに関する私の最初の投稿なので、こんにちは。
私はXcodeとObj-Cも初めてなので、厳しすぎないでください。
スタンフォード大学のデモをフォローしていますyoutube.com/watch?v=L-FK1TrpUng何らかの理由でエラーが発生しました。ゼロから始めるのではなく、どこが間違っているのかを理解したいと思います。
さて、ここに行きます。
私は2つのビューコントローラーを持っており、現在プッシュとポップについて学んでいます。
私の最初のビューコントローラー(firstViewController.h)ヘッダー:
#import <UIKit/UIKit.h>
@interface FirstViewController : UIViewController {
}
- (IBAction)pushViewController:(id)sender;
@end
次に、最初にこれが実装ファイル(firstViewController.m)で次のように設定されました
#import "firstViewController.h"
@implementation FirstViewController
- (IBAction)pushViewController:(id)sender{
}
この時点で、IBを使用してCtrlキーを押して「ファイルの所有者」から「UIButton」にドラッグし、「pushViewController」に接続しました。
しかし、途中でなんらかのエラーが発生し、無視しました。
これで、2番目のViewControllerがfirstViewController.mに次のように追加されました。
#import "firstViewController.h"
#import "secondViewController.h"
@implementation FirstViewController
- (IBAction)pushViewController:(id)sender{
SecondViewController *secondViewController = [[SecondViewController alloc] init];
secondViewController.title = @"Second";
[self.navigationController pushViewController:secondViewController animated:YES];
[secondViewController release];
}
以前に受け取ったエラーにより、secondViewControllerペン先のtextLabelからCtrlキーをドラッグできなくなったようです。
(secondeViewController.h)
#import "firstViewController.h"
#import "secondViewController.h"
@implementation FirstViewController
- (IBAction)pushViewController:(id)sender{
SecondViewController *secondViewController = [[SecondViewController alloc] init];
secondViewController.title = @"Second";
[self.navigationController pushViewController:secondViewController animated:YES];
[secondViewController release];
}
そこで、firstViewController.xibで右クリックして、元のUIButtonから参照を削除しました。
これで、「ファイルの所有者」から「UIButtons」、「pushViewController」アウトレット(アウトレットですか、それともアクションですか?)へのリンクを再作成したり、secondViewControllersペン先に「ファイルの所有者」から「UILabel」へのリンクを作成したりできません。 '。
何か助けはありますか?
誰かが興味を持っているなら、ここにファイルを投影してください。http://zer-o-one.com/upload/files/PushPop.zip
とても有難い。