just iterate through your pages array and set a boolean flag if any of the terms exist
//
// customstring.m
//
// Created by rbertsch8 on 8/2/13.
//
//
#import "customstring.h"
@implementation customstring
-(bool)hasPrefixArray:(NSArray*)array withbaseURL:(NSString*)baseUrl
{
bool hasprefix = NO;
for(int i = 0; i < [array count] || hasprefix == NO; i++)
{
hasprefix = [self hasPrefix:[baseUrl stringByAppendingString:[array objectAtIndex:i]]];
}
return hasprefix;
}
@end
Now in your code do the following:
//import your custom string file
#import NSStringPrefix.h
NSStringPrefix *customURL = yoururl.com
NSString *baseUrl = baseurl.com
NSArray *yourarray = [[NSArray alloc] initWithObjects: @"one", @"two"]
if([customURL hasPrefixArray:yourarray withbaseURL:baseUrl])
{
//dowork
}
UPDATE
Define the variables in a global class.
#define companyOrSiteName @"Company X"
#define baseUrl @"http://www.example.com/" // Set base URL for site.
#define customUrlScheme @"example://" // Set custom URL Scheme for app.
#define openInModal [NSArray arrayWithObjects: @"contact-us.php",@"products/",nil]
#define openInSafari [NSArray arrayWithObjects: @"about",@"products/resources/download",nil]
#define twitterHandle @"Example" // Twitter username without the "@" symbol
#define kTrackingId @"UA-4564564-3" // Set Google Analytics iOS App Tracking code.
hasPrefix
? – Turban