开发者

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

开发者 https://www.devze.com 2023-03-03 14:12 出处:网络
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

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

精彩评论

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