|
| Return value from Objective C Procedure |
| Iniciado por guest, 04,oct. 2017 15:05 - 2 respuestas |
| |
| | | |
|
| |
| Publicado el 04,octubre 2017 - 15:05 |
Hi Guys,
hopefully you can help me, I have created a procedure in Objective C for iOS whereby i pass a string to the procedure and it replaces the ' character with a blank space. This is my code as below:
void REPLACE_CHARACTERS(NSString* ORIG) { NSString *str = ORIG; str = [str stringByReplacingOccurrencesOfString:@"'" withString:@" "]; return str }
How do i use the 'str' value back in my main project? it doesn't appear i can assign the returned value to a global variable.
Any help is appreciated,
Many thanks
Ben |
| |
| |
| | | |
|
| | |
| |
| Publicado el 05,octubre 2017 - 15:53 |
Call your procedure like this
sReturnedString is string = REPLACE_CHARACTERS(sStringPassed)
This is how I retrieve values from JS procedures in WebDev hope it works the same way |
| |
| |
| | | |
|
| | |
| |
| Publicado el 05,octubre 2017 - 16:20 |
Hi
You should declare
NSString* REPLACE_CHARACTERS(NSString* ORIG) instead of void
and it should work
HTH
King |
| |
| |
| | | |
|
| | | | |
| | |
|