1

iOS開発初心者です。XCode 4.5 を使用しています。プロジェクトを実行したときにストーリーボードにボタンと UITableView があり、すべて正常に機能しましたが、その後、ストーリーボードの下部にツールバーを追加したように、デザインの更新が停止しましたが、プロジェクトを実行したときに表示されません。すべてをチェックしました。ボタンの位置、TableViewの位置を変更し、プロジェクトをクリーンアップしてから再構築しますが、効果はありません...助けていただければ幸いです..

MyViewController.h 

#import <UIKit/UIKit.h> 
@interface TweetifyViewController : UIViewController{ 
   IBOutlet UITableView *tweetsContainer;
   NSArray *tweets; 
   NSMutableData *data; 
}

- (IBAction)composeTweet:(id)sender; 
- (IBAction)viewMentions:(id)sender; 

@end

MyViewController.m

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}


- (int)numberOfSectionsInTableView:(UITableView *)tableView
{
    return  1;
}

- (int)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [tweets count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
 {
        static NSString *customTableIdentifier = @"CustomTableCell";

        CustomTableCell *cell = (CustomTableCell *)[tableView dequeueReusableCellWithIdentifier:customTableIdentifier];
        if (cell == nil)
        {
            NSArray *nib = [[NSBundle mainBundle] loadNibNamed:customTableIdentifier owner:self options:nil];
            cell = [nib objectAtIndex:0];
        }

        cell.Name.text = [[[tweets objectAtIndex:indexPath.row] objectForKey:@"user"] objectForKey:@"name"];
        NSString *At = @"@";
        NSString *AtUserName = [[[tweets objectAtIndex:indexPath.row] objectForKey:@"user"] objectForKey:@"screen_name"];
    cell.userName.text = [NSString stringWithFormat:@"%@%@",At, AtUserName];
    NSData *imageData = [NSData dataWithContentsOfURL:imageURL];
    cell.avatar.image = [UIImage imageWithData:imageData];
    cell.tweetText.text = [[tweets objectAtIndex:indexPath.row] objectForKey:@"text"];

    return cell;
}

- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 120;
}


- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}
4

1 に答える 1

0

ツールバーを追加した場所が明確ではありません:

ストーリーボードの一番下に

おそらくツールバーはtableViewの下に配置されているので、それを選択してメニューに入れますEditor->Arrange->Send to front

于 2013-01-26T08:46:38.007 に答える