Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 06-29-2011, 02:18 PM   #1 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 2
lucashaas is on a distinguished road
Smile TabView App Crash

Hello everyone

I'm beginner with Apple development and I'm trying to make an TabBar application.

Ok, no problem here, But, the first view of this app will display an video.

Everything is ok, the video framework, the button, etc. (I've done a video application before, but using the Window based application).

When I lauch the Application, it works fine, without error. But when I touch to play the video, the app crash.

Debugging the app, I've found something in main.m file. here the code:

int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}

what is wrong? can anyone help me?

Thanks a lot!
lucashaas is offline   Reply With Quote
Old 06-29-2011, 02:32 PM   #2 (permalink)
Nuisance Developer
 
Join Date: Jul 2009
Location: Italy
Posts: 4,691
dany_dev is on a distinguished road
Default

what about posting the code of the "play" button?
__________________
dany_dev is offline   Reply With Quote
Old 06-29-2011, 02:55 PM   #3 (permalink)
Registered Member
 
Join Date: Jun 2011
Posts: 2
lucashaas is on a distinguished road
Default

Quote:
Originally Posted by dany_dev View Post
what about posting the code of the "play" button?
here the code that I use for video:



-(IBAction)playMovieid)sender
{
UIButton *playButton = (UIButton *) sender;

NSString *filepath = [[NSBundle mainBundle] pathForResource:@"flights_granada_1" ofType:@"mov"];
NSURL *fileURL = [NSURL fileURLWithPath:filepath];
MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL];

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

[moviePlayerController.view setFrame:CGRectMake(playButton.frame.origin.x,
playButton.frame.origin.y,
playButton.frame.size.width,
playButton.frame.size.height)];

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

//moviePlayerController.scalingMode = MPMovieScalingModeFill;

[moviePlayerController play];
}

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

[moviePlayerController.view removeFromSuperview];
[moviePlayerController release];
}


This application, If Window-Based works good. But I need to put this video in a View inside a Tab Bar application. But the app crash =(
lucashaas is offline   Reply With Quote
Old 06-29-2011, 04:50 PM   #4 (permalink)
Registered Member
 
Join Date: Feb 2011
Posts: 97
Bopols is on a distinguished road
Default

debug and step through the code to see which line trips the error.
Bopols is offline   Reply With Quote
Reply

Bookmarks

Tags
tab bar application, video, view-based

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 337
7 members and 330 guests
chemistry, iOS.Lover, lendo, leostc, Leslie80, pbart, VinceYuan
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,664
Threads: 94,120
Posts: 402,898
Top Poster: BrianSlick (7,990)
Welcome to our newest member, Leslie80
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:30 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0