Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7171553
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:26:13+00:00 2026-05-28T15:26:13+00:00

Ok, so I failed to post my code properly last time … I am

  • 0

Ok, so I failed to post my code properly last time … I am the newbie. I altered things a bit and I am trying to get the video to play out of a uiTableView. I don’t get a crash, I just get a black screen for about 20 seconds and then the simulator or iPhone returns to the uiTableView. When I select “option 1”, I get the alert as expected. I am using Xcode 4.2 developing for iOS 4.0.

I have been searching and banging my head for a few days and any help is appreciated.

Here is my .h

#import <UIKit/UIKit.h>
#import <MediaPlayer/MediaPlayer.h> 

@interface faq2 : UITableViewController 
{
    NSArray *faqList;
}
@property (nonatomic, strong) NSArray *faqList;
-(IBAction)playMovie;
@end

Here is my .m

-(IBAction)playMovie 
{  
    NSString *filepath = [[NSBundle mainBundle] pathForResource:@"WhatFinalTake" ofType:@"mp4"];  
    NSURL    *fileURL = [NSURL fileURLWithPath:filepath];  
    MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];  

    [[NSNotificationCenter defaultCenter] addObserver:self  
                                             selector:@selector(moviePlaybackComplete:)  
                                                 name:MPMoviePlayerPlaybackDidFinishNotification  
                                               object:moviePlayerController];  

    [self.view addSubview:moviePlayerController.view];  
    moviePlayerController.fullscreen = YES;  
    [moviePlayerController play];   
}

- (void)moviePlaybackComplete:(NSNotification *)notification  
{  
    MPMoviePlayerController *moviePlayerController = [notification object];  
    [[NSNotificationCenter defaultCenter] removeObserver:self  
                                                    name:MPMoviePlayerPlaybackDidFinishNotification  
                                                  object:moviePlayerController];  

    [moviePlayerController.view removeFromSuperview];
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    self.faqList = [[NSArray alloc] initWithObjects:
                    @"Play Movie",
                    @"Option 1", nil];

    self.title = @"Frequently Asked Questions";
}

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

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    // Return the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [faqList count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) 
    {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }
    // Configure the cell.
    cell.textLabel.text = [self.faqList objectAtIndex: [indexPath row]];
    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0)
    {
        [self playMovie];
    }
    else if (indexPath.row == 1)
    {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Option 1" message:@"Option 1" delegate:nil cancelButtonTitle:@"Close" otherButtonTitles:nil, nil];
        [alert show];
    }
}

I am pretty sure I added the framework proplerly, but JIK here is the screenshot.
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T15:26:14+00:00Added an answer on May 28, 2026 at 3:26 pm

    I have tested your code and found that your filePath string is nil. Try this :

    NSString *filepath = [NSString stringWithFormat:@"%@",[[NSBundle mainBundle] pathForResource:@"WhatFinalTake" ofType:@"mp4"]];  
    NSLog(@"%@",filepath);
    NSURL    *fileURL = [NSURL fileURLWithPath:filepath];  
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I send a POST request from IPhone to Django and get CSRF verification failed,
I have an ASP.NET MVC page with multiple file uploads. After a failed post,
Target failed to run: Remote exception encountered: Faild to get task for pid 3103
I just enabled Failed Request Tracing for a site and I get a URL_CHANGED
The following code failed when I upgraded to 1.4.1, and worked ok when I
I found this code and am trying to adjust it to the way I
The following code will post the error message: // object is a color image
I'm making a post httpwebrequst, but in the HttpWebResponse im getting an error code
I have this login code, which works last night before I slept. Nobody used
Whenever I try to post data values in PHP I get the following error:

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.