I've got an application that uses more than one action sheet, and I'm having problems because of it. Adding the actual action sheets is fine, but then when I set what the buttons do, I get the following error:
redefinition of '-[My_Project_NameViewController actionSheet:clickedButtonAtIndex:]'
So Xcode's telling me I can't use this multiple times:
I've got an application that uses more than one action sheet, and I'm having problems because of it. Adding the actual action sheets is fine, but then when I set what the buttons do, I get the following error:
redefinition of '-[My_Project_NameViewController actionSheet:clickedButtonAtIndex:]'
So Xcode's telling me I can't use this multiple times:
So what do I do? I'm fairly new to coding and objective-c, so please help me out by maybe giving me an example. Thanks!
And what's up with the frowning faces above?!?!?!
Ok so fair enough is the error that u cant use this multiple times, lets go to why?? and then I will give u the solution.
are u familiar with 'C' language....so have u heard like one function declaration and two definitions of that function...NO isn't it...same is the case here...
this function tells what to do when a button on action sheet is clicked
no how it will allow u to define that thing at two different place...
so now lets come to the solution...as u said u have more than one action sheets so give them different names and inside this function give condition on which action sheet the button is clicked for eg below:-
Ok so fair enough is the error that u cant use this multiple times, lets go to why?? and then I will give u the solution.
are u familiar with 'C' language....so have u heard like one function declaration and two definitions of that function...NO isn't it...same is the case here...
this function tells what to do when a button on action sheet is clicked
no how it will allow u to define that thing at two different place...
so now lets come to the solution...as u said u have more than one action sheets so give them different names and inside this function give condition on which action sheet the button is clicked for eg below:-
And for avoiding smileys enclose ur code in <CODE> tags as I have done above
Oooohhh... Thanks a lot! I really should try to learn more about Obj. C. Maybe I'll get a book or something. Again, thanks! This will help a lot in future apps.
Ok so fair enough is the error that u cant use this multiple times, lets go to why?? and then I will give u the solution.
are u familiar with 'C' language....so have u heard like one function declaration and two definitions of that function...NO isn't it...same is the case here...
this function tells what to do when a button on action sheet is clicked
no how it will allow u to define that thing at two different place...
so now lets come to the solution...as u said u have more than one action sheets so give them different names and inside this function give condition on which action sheet the button is clicked for eg below:-
And for avoiding smileys enclose ur code in <CODE> tags as I have done above
Well, I tried this out. And I don't know if I did it right (and I'm pretty sure I didn't) because it isn't working. There are no errors, but when I run the application, the buttons on the action sheets don't work. Again, I'm new to coding, so I probably made some stupid mistake. Here's my code:
i know I am late to reply..but still if u r stuck...tell me exactly what do u want to do..what are these IBActions for...and what is the error that u got in ur code...and then i can give u exact solution..or better if u want tell me ur skype id (if u r on skype) ... and we can discuss ur problem there
i know I am late to reply..but still if u r stuck...tell me exactly what do u want to do..what are these IBActions for...and what is the error that u got in ur code...and then i can give u exact solution..or better if u want tell me ur skype id (if u r on skype) ... and we can discuss ur problem there
That Skype idea is cool. But what kind of Skyping? Chat or call? Mine is joecruso51.
Ok so fair enough is the error that u cant use this multiple times, lets go to why?? and then I will give u the solution.
are u familiar with 'C' language....so have u heard like one function declaration and two definitions of that function...NO isn't it...same is the case here...
this function tells what to do when a button on action sheet is clicked
no how it will allow u to define that thing at two different place...
so now lets come to the solution...as u said u have more than one action sheets so give them different names and inside this function give condition on which action sheet the button is clicked for eg below:-
And for avoiding smileys enclose ur code in <CODE> tags as I have done above
Hey, that code is great for multiple action sheets but how do I a action to each of the button in each action sheet, in this method I only see a way to add a action to 1 button on each sheet