开发者

Getting "EXC_BAD_ACCESS" error on running .c function in objective-c .m class, work fine on simulator but not on device

First off my code was working fine on simulator but it does not work on device. I have client.h and client.c file in which I have declared a method

extern int getConfigeFile(char *pFileName, char *pFilePath);

in client.h and implement this on client.c

Now i am callin开发者_运维百科g this method from my Appdelegate and i also included header file of client.h

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    
      int status = getConfigeFile("FileName" , "Document Directory path here"); <-- Getting EXC_BAD_ACCESS error on this line

...


In .c file check if there is any macro defined like

#defined DATALENGTH 256 

which is used in function for constant value , which should be less than 128 or 64 in your case i.e

#defined DATALENGTH 64
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜