Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2017, 06:57:59 PM
Home Help Search chat Login Register 
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan

+ Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+ iOS Programming
| |-+ General Questions
| | |-+ Define Kbase Url
Pages: [1] Go Down
Author Topic: Define Kbase Url (Read 878 times)
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"]};

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"]];

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:@""];

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

Pages: [1] Go Up
Jump to:

Login with username, password and session length

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 (c) 2009 classroomM.com. All rights reserved.