私のアプリには7つのボタンがあります。下矢印を押した後、そのビューに3つのボタンを表示しています。他の3つのボタンが表示されます
1.Facebookで共有 2.Twitterで共有 3.友達に教える 4.報告する 5.スターターガイド 6.私のウェブサイトにアクセスする 7.フィードバックする
LIKE THIS MY VIEW
====================
^ ---->up arrow
facebook share
Twitter share
Tell a friend
V ---->down arrow
「友達に教える」ボタンと「報告する」ボタンにmailcomposerviewを使用しています
「友達に教える」または「報告」ボタンを押すと、閉じた後にmailcomposerviewが開き、上下の矢印を移動できません......上下の矢印を押すと、同じメールcomposerviewが開きますまた、facebook 共有と twitter 共有も開かない
この問題を解決するのを手伝ってください
矢印が押されたときの私のコーディング
-(void)arrTapped1:(id)sender
{
CCMenuItem *item2=(CCMenuItem*)sender;
int k=item2.tag;
////CCLOG(@"k tapp=%dhelp=%d",k,helpVal);
NSLog(@"HelpVal%i",helpVal);
if(k==51)
{
if(helpVal<3)
{
id action1=[CCMoveBy actionWithDuration:0.3 position:ccp(0,+260)];
id callfun1=[CCCallFunc actionWithTarget:self selector:@selector(enabled1) ];
[item2 setIsEnabled:YES];
[(CCSprite*)[self getChildByTag:10] runAction:[CCSequence actions:action1,callfun1,nil]];
[self performSelector:@selector(downWardsMove)];
}
}
else //if(k==50)
{
if(helpVal>1)
{
id action1=[CCMoveBy actionWithDuration:0.3 position:ccp(0,-260)];
id callfun1=[CCCallFunc actionWithTarget:self selector:@selector(enabled1) ];
[item2 setIsEnabled:YES];
[(CCSprite*)[self getChildByTag:10] runAction:[CCSequence actions:action1,callfun1,nil]];
[self performSelector:@selector(upWardsMove)];
} } }
//code for upwards & downwards move
//--------------------------------
-(void)upWardsMove
{
[upArrItem setIsEnabled:NO];
[downArrItem setIsEnabled:NO];
self.isTouchEnabled=NO;
helpVal--;
[(CCMenu*)[self getChildByTag:53] setVisible:YES];
[downArrItem setIsEnabled:YES];
if(helpVal==1)
{
[(CCMenu*)[self getChildByTag:52] setVisible:NO];
[upArrItem setIsEnabled:NO];
}
}
-(void)downWardsMove
{
[upArrItem setIsEnabled:NO];
[downArrItem setIsEnabled:NO];
self.isTouchEnabled=NO;
helpVal++;
[(CCMenu*)[self getChildByTag:52] setVisible:YES];
[upArrItem setIsEnabled:YES];
if(helpVal==3){
[(CCMenu*)[self getChildByTag:53] setVisible:NO];
[downArrItem setIsEnabled:NO];
}
}
-(void)enabled1
{
self.isTouchEnabled=YES;
[upArrItem setIsEnabled:YES];
[downArrItem setIsEnabled:YES];
if(helpVal==3)
{
[(CCMenu*)[self getChildByTag:53] setVisible:NO];
[downArrItem setIsEnabled:NO];
}
if(helpVal==1)
{
[(CCMenu*)[self getChildByTag:52] setVisible:NO];
[upArrItem setIsEnabled:NO];
}
}
//sending mail code
//------------------
-(void)sendMail
{
mailComposer = [[UIViewController alloc] init];
[[[CCDirector sharedDirector] openGLView] addSubview:mailComposer.view];
MFMailComposeViewController *mailController= [[MFMailComposeViewController alloc] init];
mailController.mailComposeDelegate = self;
[mailController setSubject:msgSubject];
[mailController setMessageBody:mailContent isHTML:YES];
NSArray *toRecipients = [NSArray arrayWithObject:@"Info@ask.com"];
[mailController setBccRecipients:toRecipients];
[mailComposer presentModalViewController:mailController animated:NO];
mailComposer.view.transform = CGAffineTransformMakeRotation( CC_DEGREES_TO_RADIANS(90.0f ) );
[mailController release];
[[CCDirector sharedDirector] setDeviceOrientation: kCCDeviceOrientationLandscapeRight]
}
-(void)mailComposeController:(MFMailComposeViewController*)mailController didFinishWithResult: (MFMailComposeResult)result error:(NSError*)error
{
[mailComposer dismissModalViewControllerAnimated:YES];
}