0

I have moved all string literals getting used in my app to a header file : myheader.h---

static NSString* const mystring1=@"SomeString1" ; 
static NSString* const mystring2=@"SomeString2" ; 
static NSString* const mystring3=@"SomeString3" ; 
static NSString* const mystring4=@"SomeString4" ; 
static NSString* const mystring5=@"SomeString5" ; 

and in main.cpp:

#include myheader.h

main(){
...code using  NSString* from header;
}

Will that increase my app load time?

  • 1
    Is like asking if the fan is on will I open the door faster. The compiler will perform a lot of string optimisation, what you are trying to do by hand - you should really not worry about this kind of stuff. Do you have poor app load time that you want to fix? Then I think the trouble is elsewhere. – skaak Apr 01 '21 at 11:24
  • 1
    "Will that increase my app load time" - did you measure it? – koen Apr 01 '21 at 11:51
  • Yes I am trying to solve poor app load time of an app that integrates my library. Binary size has not been changed and execution time of my API is also same if i compare that with the previous version. – Monika Nainwal Apr 05 '21 at 10:09

0 Answers0