I am getting EXC_BAD_ACCESS in creating NSString using stringWithFormat

350 views Asked by At

Stack trace:

0   libobjc.A.dylib                 0x00007fff2021a26e objc_opt_respondsToSelector + 27
1   com.apple.CoreFoundation        0x00007fff20405674 __CFStringAppendFormatCore + 9123
2   com.apple.CoreFoundation        0x00007fff20534412 _CFStringCreateWithFormatAndArgumentsReturningMetadata + 145
3   com.apple.CoreFoundation        0x00007fff204032cb _CFStringCreateWithFormatAndArgumentsAux2 + 20
4   com.apple.Foundation            0x00007fff210d1eef +[NSString stringWithFormat:] + 153

Faulting Code:

NSString* GetPlistPath(){
    return [[NSString stringWithFormat:@"%@/%@/%@",UserLibrary,PREFERENCE_PLIST_DIR_NAME,PREFERENCE_PLIST_NAME] stringByExpandingTildeInPath];
}

Where UserLibrary is an NSString* and PREFERENCE_PLIST_DIR_NAME and PREFERENCE_PLIST_NAME are NSString* const.

0

There are 0 answers