objective c - Where is an ideal location to store the root url in an iOS app to get access to an external API? -
where ideal location store root url in ios app access external api? i'm thinking of using nsbundle not sure if right. or should using constant variable? thanks in advance! you have few options: create static class built interact api , keep url there. you can use constant variable defined in 1 of headers , import it you can use constant variable defined in prefix.pch (i don't recommend this) when build production grade apps use 1st one. takes little bit longer, cleans code more. let's i'm interacting api has todo list on server somewhere. want request first todo list item each todo list item title , content. i'll first create todo list class has 2 properties , 1 method: @property (nonatomic, strong) nsstring *title; @property (nonatomic, strong) nsstring *content; + (mytodolistitem*)todolistitemfromdictionary:(nsdictionary*)dict; all 1 method convert dictionary create in networking class json response todolist item. now ne...