Re: Hurdles in converting to Swift
Re: Hurdles in converting to Swift
- Subject: Re: Hurdles in converting to Swift
- From: Roland King <email@hidden>
- Date: Thu, 24 Dec 2015 09:44:44 +0800
Is SearchViewController actually referenced in your code somewhere? You need something in the binary which would cause the class to get loaded in the first place or it will not be linked into the binary and not found by IB. This has been an issue with IB and objC forever, I don’t see why Swift would be any different.
I have dummy bits of code in a few of my apps which do nothing but get the class of objects in IB which aren’t in the code elsewhere, that is enough to keep the class in the image. I suspect your issue is something similar
> On 24 Dec 2015, at 09:38, John Brownie <email@hidden> wrote:
>
> I have a fairly simple iOS application that was working in Objective-C, and which I've now rewritten in Swift, by rewriting each class and removing the old .m and .h files, and keeping the storyboard. However, it falls over immediately with the console message:
>
> 2015-12-24 10:43:40.664 AppName[10464:1086828] Unknown class SearchViewController in Interface Builder file.
>
> After that, it crashes with an uncaught exception (which looks like it's related to the above):
>
> 2015-12-24 10:43:40.707 AppName[10464:1086828] *** Terminating app due to uncaught exception 'NSUnknownKeyException', reason: '[<UIViewController 0x7b83a990> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key activityIndicator.'
>
> Of course, there is an appropriate class called SearchViewController in the application, and it has an outlet activityIndicator, and it's set as the class for one scene. I've cleaned the build folder, but it still happens.
>
> Any wisdom on how to proceed?
>
> John
> --
> John Brownie, email@hidden or email@hidden
> Summer Institute of Linguistics, Ukarumpa, Eastern Highlands Province, Papua New Guinea
> Mussau-Emira language, Mussau Island, New Ireland Province, Papua New Guinea
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden