In my app i am having 7 button i am show 3 button in that view after pressing down arrow it show other 3 button
1.Facebook share
2.twitter share
3.tell a friend
4.report
5.starter guide
6.visit my web site
7. feed back
LIKE THIS MY VIEW
====================
^ ---->up arrow
facebook share
Twitter share
Tell a friend
V ---->down arrow
i am using mailcomposerview for “tell a friend” button and “report” button
when i press “Tell a Friend” or “report” button it opens mailcomposerview after closing that i am not able to move the up and down arrow……if i press the up and down arrow it open the same mail composerview,its also not opening facebook share and twitter share
please help me to fix this issue
my coding when arrow pressed
-(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];
}
Here is a part of a code that I used in my apps and it works well in iOS 4.0 – iOS 6.0. Take a look: