objective c - Global variables in IPHONE APP -


How to declare and use global variables with extern in Objective-C and other files

I want to define defined and global variables in 1.h file and 1.m and want to use it in 2.m file

I'm defining < / P>

1.h

External Const NSString * str;

1.m

  NSString * str = @ "hello"; I'm importing  1.h  in   

I want to use the string But give me 2.o error

If these are application settings, then you should consider using NSUserDefaults. If this is the constant, you should define them in the prefix header file.


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -