Categories in Objective-C aren't working

前端 未结 5 951
时光说笑
时光说笑 2020-12-16 18:51

I\'m developing an iOS application that needs to deploy to iOS 3.1.3. I need to extend some of the functionality of the NSData class and am using the following code inside N

5条回答
  •  情书的邮戳
    2020-12-16 19:12

    It really seems like your category isn't being compiled or linked into the same target that you're using it from. You should make sure that NSData+Base64.m is marked to be compiled by the same target that it's being used from by getting info on the two files and comparing the targets they're assigned to.

    A test you can perform is to add a line with an #error error message to NSData+Base64.m, which will cause the build to fail when it gets to that file. Like this:

    #error We're now compiling NSData+Base64.m
    

    Then look and see which target fails to compile.

提交回复
热议问题