Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
December 17, 2017, 08:56:18 AM *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register Chat  
Pages: [1]   Go Down
  Print  
Author Topic: Define Kbase Url  (Read 1495 times)
sampp18
Newbie
*
Posts: 1


« on: August 24, 2016, 12:22:11 AM »

Hye,I having some problem here please help me as im new to xcode and objective C


#define kBaseURL      @"http://api.pokemon.com/"
I defined ^ on my prefix.pch file

And to make maintenance easier in the future,so By defining kBaseURL = "http://api.pokemon.com/" I wouldnt have to manually edit every single line on my code and just by editing on my prefix page.

1)NSDictionary *dictchat;
        if ([[responseDict objectForKey:@"user_id"] isEqual:[NSNull null]]) {
            dictchat = @{@"UtoB":@"YES", @"user_id":@"1", @"first_name":@"Support", @"last_name":@"Oncalled", @"avatar_url":@"http://api.pokemon.com/images/original/missing.png", @"business_id":[responseDict objectForKey:@"id"], @"business_title":[responseDict objectForKey:@"profile_title"]};

2)
NSString *Name=[NSString stringWithFormat:@"%@",[[self.filteredArray objectAtIndex:[sender tag]] valueForKey:@"company_name"]];
        NSString *Title=[NSString stringWithFormat:@"http://api.pokemon.com/web/promotions/%@",[[self.filteredArray objectAtIndex:[sender tag]] valueForKey:@"id"]];

3)
NSString *tempString;
            if ([self.filteredArray[indexPath.row]valueForKey:@"post_url"]!=nil|| [[self.filteredArray[indexPath.row]valueForKey:@"post_url"] isKindOfClass:[NSNull class]])
            {
                tempString = [[self.filteredArray[indexPath.row]valueForKey:@"post_url"] stringByReplacingOccurrencesOfString:@"http://web.oncalled.com" withString:@"http://139.59.244.178"];

How to replace instead of using the link,I replace kBaseURL within the avatar url above,really appreciate helps it so much

Logged
Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents ゥ 2009 classroomM.com. All rights reserved.