Problem with "and" and "or" MatchExpression

Post here your questions about the Objective-C API for SFS2X

Moderators: Lapo, Bax

crosskid
Posts: 36
Joined: 30 Oct 2012, 07:56

Problem with "and" and "or" MatchExpression

Postby crosskid » 23 Nov 2012, 06:21

Hi, in one class

i wrote like this

Code: Select all

MatchExpression *exp = [MatchExpression expressionWithVarName:@"stakes" condition:[StringMatch stringMatchEquals] value:[NSString stringWithFormat:@"%d",[PlayerInfo instance].gameBuyIn]];
exp = [exp and:@"$GS" condition:[BoolMatch boolMatchEquals] value:@"false"];


and shows no problem

but in another class, when i'm using this expression it's shows syntax error about parse issue "expected expression"
the "and" code color turns into pink not cyan/blue

is there anything wrong? i already clean up and delete the derived data but still show error

for now i changed the

Code: Select all

-(MatchExpression *)and:(NSString *)varName condition:(id <IMatcher>)condition value:(id)value;


method in the MatchExpression.h into

Code: Select all

-(MatchExpression *)ands:(NSString *)varName condition:(id <IMatcher>)condition value:(id)value;


for resolving this issue, is this can affect other things?

thanks
User avatar
A51Integrated
Posts: 240
Joined: 03 Jan 2012, 19:55
Location: Toronto, Canada
Contact:

Re: Problem with "and" and "or" MatchExpression

Postby A51Integrated » 24 Nov 2012, 12:11

From the xcode menu, find Show Invisibles and make sure it's checked. Sometimes, when you copy code, strange characters will be copied as well. See if there is anything that shouldnt be there and delete it. This is strictly an XCode/Obj-C issue.
A51 Integrated
http://a51integrated.com / +1 416-703-2300
crosskid
Posts: 36
Joined: 30 Oct 2012, 07:56

Re: Problem with "and" and "or" MatchExpression

Postby crosskid » 26 Nov 2012, 03:21

thanks, that should do the trick :D
arklay
Posts: 14
Joined: 12 Dec 2012, 17:04

Re: Problem with "and" and "or" MatchExpression

Postby arklay » 13 Dec 2012, 11:41

Hi,

I had that problem when using ObjC++ (.mm extension)

I solved it by creating a category:

Code: Select all

#import <SFS2XAPIIOS/SmartFox2XClient.h>

@interface MatchExpression (Helper)
-(MatchExpression *)_and:(NSString *)varName condition:(id <IMatcher>)condition value:(id)value;
@end


Code: Select all

#import "MatchExpression+Helper.h"

@implementation MatchExpression (Helper)
-(MatchExpression *)_and:(NSString *)varName condition:(id <IMatcher>)condition value:(id)value
{
    return [self and:varName condition:condition value:value];
}
@end

Return to “SFS2X iPhone / iPad / OSX API”

Who is online

Users browsing this forum: No registered users and 39 guests