开发者

Unrecognized selector sent to instance on custom init method

I have an object called Communicator.

Communicator has a custom init method -(id)initWithEmail:(NSString*)theEmail andPassword:(NSString*)thePassword andPlatform:(NSString*)thePlatform;.

My app delegate has a Communicator as a member variable called communicator.

In applicationDidFinishLaunching I do this

communicator = [[Communicator alloc] initWithEmail:@"email" andPassword:@"password" andPlatform:@"mac"];

In the console it prints -[Communicator initWithEmail:andPassword:andPlatform:]: unrecognized selector sent to instance 0x10064c4b0 twice.

The method exists and is defined. "communicator" is definitely a Communicator开发者_如何学Go object. The project compiles with no warnings.

Communicator is defined in a custom framework that I made myself. I used otool and it says that the initWithEmail:andPassword:andPlatform method is in there.

It would seem that I've messed something up when building the framework but I have no idea what it could be. The project builds, links, and launches without a problem. Is there some project setting that I might have messed up? Any other ideas?


I had some stuff set up wrong. Instead of dealing with Framework install paths on the custom framework, I just copied it to the frameworks folder. Of course I forgot that I did that and every time I made an update to the framework, it was going agains that old copy I stuck in the frameworks folder. This was super frustrating.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜