Xcodeビルド時に「Undefined Symbol: method descriptor for Swift.CustomStringConvertible.des…」

Unity製のアプリをXcodeビルド時にみたことないエラーが大量に。

エラー100件…

エラー内容↓
Showing Recent Issues
Undefined symbol: method descriptor for Swift.CustomStringConvertible.description.getter : Swift.String

Undefined symbol: protocol descriptor for Swift.CustomStringConvertible

Undefined symbol: __swiftEmptyDictionarySingleton

Undefined symbol: _swift_errorRelease

Undefined symbol: method descriptor for Swift.Error._userInfo.getter : Swift.AnyObject?

Undefined symbol: method descriptor for Swift.Error._code.getter : Swift.Int

Undefined symbol: method descriptor for Swift.Error._getEmbeddedNSError() -> Swift.AnyObject?

Undefined symbol: (extension in Foundation):Swift.Error< where A: Foundation.CustomNSError>._code.getter : Swift.Int

Undefined symbol: protocol conformance descriptor for Swift.Int : Swift.FixedWidthInteger in Swift

Undefined symbol: type metadata for Any

Undefined symbol: type metadata for Swift.Int

Undefined symbol: method descriptor for Foundation._ObjectiveCBridgeableError.init(_bridgedNSError: __shared __C.NSError) -> A?

Undefined symbol: base conformance descriptor for Foundation._BridgedStoredNSError: Swift.Hashable

Undefined symbol: (extension in Foundation):Foundation._BridgedStoredNSError.errorCode.getter : Swift.Int

Undefined symbol: (extension in Foundation):Foundation._BridgedStoredNSError._getEmbeddedNSError() -> Swift.AnyObject?

Undefined symbol: base conformance descriptor for Foundation._BridgedStoredNSError: Foundation.CustomNSError

Undefined symbol: method descriptor for Foundation._BridgedStoredNSError.init(_nsError: __C.NSError) -> A

Undefined symbol: associated conformance descriptor for Foundation._BridgedStoredNSError.Code: Swift.RawRepresentable

Undefined symbol: associated conformance descriptor for Foundation._ErrorCodeProtocol._ErrorType: Foundation._BridgedStoredNSError

Undefined symbol: protocol descriptor for Foundation._ErrorCodeProtocol

Undefined symbol: _swift_bridgeObjectRetain

Undefined symbol: associated conformance descriptor for Swift.ExpressibleByStringLiteral.StringLiteralType: Swift._ExpressibleByBuiltinStringLiteral

Undefined symbol: method descriptor for Foundation.CustomNSError.errorCode.getter : Swift.Int

Undefined symbol: (extension in Foundation):Foundation._BridgedStoredNSError.hash(into: inout Swift.Hasher) -> ()

Undefined symbol: _swift_getObjCClassFromMetadata

Undefined symbol: associated type descriptor for _ErrorType

Undefined symbol: method descriptor for Swift.ExpressibleByExtendedGraphemeClusterLiteral.init(extendedGraphemeClusterLiteral: A.ExtendedGraphemeClusterLiteralType) -> A

Undefined symbol: protocol descriptor for Swift.ExpressibleByUnicodeScalarLiteral

Undefined symbol: (extension in Foundation):Foundation._BridgedStoredNSError.errorUserInfo.getter : [Swift.String : Any]

Undefined symbol: method descriptor for Foundation._BridgedStoredNSError._nsError.getter : __C.NSError

Undefined symbol: base conformance descriptor for Swift.ExpressibleByStringLiteral: Swift.ExpressibleByExtendedGraphemeClusterLiteral

Undefined symbol: (extension in Foundation):Swift.Error< where A: Foundation.CustomNSError>._domain.getter : Swift.String

Undefined symbol: (extension in Foundation):Foundation._BridgedStoredNSError.init(_bridgedNSError: __C.NSError) -> A?

Undefined symbol: method descriptor for Swift.ExpressibleByStringLiteral.init(stringLiteral: A.StringLiteralType) -> A

Undefined symbol: protocol witness table for Swift.String : Swift._ExpressibleByBuiltinExtendedGraphemeClusterLiteral in Swift

Undefined symbol: protocol witness table for Swift.String : Swift._ExpressibleByBuiltinStringLiteral in Swift

Undefined symbol: base conformance descriptor for Foundation.CustomNSError: Swift.Error

Undefined symbol: _swift_unknownObjectRetain

Undefined symbol: static Swift._DictionaryStorage.allocate(capacity: Swift.Int) -> Swift._DictionaryStorage<A, B>

Undefined symbol: protocol descriptor for Foundation.CustomNSError

Undefined symbol: _swift_initStaticObject

Undefined symbol: Swift._findStringSwitchCaseWithCache(cases: [Swift.StaticString], string: Swift.String, cache: inout Swift._OpaqueStringSwitchCache) -> Swift.Int

Undefined symbol: type metadata for Swift.StaticString

Undefined symbol: _swift_getWitnessTable

Undefined symbol: Swift.Hasher._combine(Swift.UInt) -> ()

Undefined symbol: Swift._StringObject.rawBits.getter : (Swift.UInt64, Swift.UInt64)

Undefined symbol: method descriptor for static Swift._ObjectiveCBridgeable._unconditionallyBridgeFromObjectiveC(A._ObjectiveCType?) -> A

Undefined symbol: associated type descriptor for ExtendedGraphemeClusterLiteralType

Undefined symbol: __swiftEmptyArrayStorage

Undefined symbol: associated type descriptor for UnicodeScalarLiteralType

Undefined symbol: protocol descriptor for Swift._HasCustomAnyHashableRepresentation

Undefined symbol: protocol descriptor for Swift.ExpressibleByExtendedGraphemeClusterLiteral

Undefined symbol: _swift_errorRetain

Undefined symbol: method descriptor for Swift.RawRepresentable.init(rawValue: A.RawValue) -> A?

Undefined symbol: method descriptor for static Swift._ObjectiveCBridgeable._conditionallyBridgeFromObjectiveC(_: A._ObjectiveCType, result: inout A?) -> Swift.Bool

Undefined symbol: Swift.Hasher.init(_seed: Swift.Int) -> Swift.Hasher

Undefined symbol: method descriptor for static Swift._ObjectiveCBridgeable._forceBridgeFromObjectiveC(_: A._ObjectiveCType, result: inout A?) -> ()

Undefined symbol: protocol descriptor for Swift._ObjectiveCBridgeable

Undefined symbol: value witness table for Builtin.Int32

Undefined symbol: base conformance descriptor for Swift._SwiftNewtypeWrapper: Swift._HasCustomAnyHashableRepresentation

Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibilityDynamicReplacements

Undefined symbol: static (extension in Foundation):Foundation._BridgedStoredNSError.== infix(A, A) -> Swift.Bool

Undefined symbol: protocol descriptor for Swift.ExpressibleByStringLiteral

Undefined symbol: base conformance descriptor for Swift._SwiftNewtypeWrapper: Swift.RawRepresentable

Undefined symbol: (extension in Foundation):Foundation._BridgedStoredNSError.init(_: A.Code, userInfo: [Swift.String : Any]) -> A

Undefined symbol: protocol descriptor for Swift._SwiftNewtypeWrapper

Undefined symbol: method descriptor for Swift.Error._domain.getter : Swift.String

Undefined symbol: __swift_FORCE_LOAD_$_swiftCompatibility50

Undefined symbol: protocol descriptor for Swift.RawRepresentable

Undefined symbol: method descriptor for static Foundation.CustomNSError.errorDomain.getter : Swift.String

Undefined symbol: (extension in Foundation):Swift.String._bridgeToObjectiveC() -> __C.NSString

Undefined symbol: Swift.String.hashValue.getter : Swift.Int

Undefined symbol: protocol descriptor for Swift.Equatable

Undefined symbol: base conformance descriptor for Swift.Hashable: Swift.Equatable

Undefined symbol: _swift_arrayDestroy

Undefined symbol: _swift_retain

Undefined symbol: protocol witness table for Swift.String : Swift.Hashable in Swift

Undefined symbol: (extension in Swift):Swift.Error._userInfo.getter : Swift.AnyObject?

Undefined symbol: protocol descriptor for Swift.Hashable

Undefined symbol: associated conformance descriptor for Swift.ExpressibleByUnicodeScalarLiteral.UnicodeScalarLiteralType: Swift._ExpressibleByBuiltinUnicodeScalarLiteral

Undefined symbol: method descriptor for Foundation.CustomNSError.errorUserInfo.getter : [Swift.String : Any]

Undefined symbol: associated type descriptor for StringLiteralType

Undefined symbol: static (extension in Foundation):Swift.String._conditionallyBridgeFromObjectiveC(_: __C.NSString, result: inout Swift.String?) -> Swift.Bool

Undefined symbol: static (extension in Foundation):Swift.String._forceBridgeFromObjectiveC(_: __C.NSString, result: inout Swift.String?) -> ()

Undefined symbol: protocol witness table for Swift.String : Swift._ExpressibleByBuiltinUnicodeScalarLiteral in Swift

Undefined symbol: method descriptor for Swift.Hashable.hashValue.getter : Swift.Int

Undefined symbol: type metadata accessor for Swift._ContiguousArrayStorage

Undefined symbol: protocol descriptor for Swift.Error

Undefined symbol: method descriptor for Swift._ObjectiveCBridgeable._bridgeToObjectiveC() -> A._ObjectiveCType

Undefined symbol: method descriptor for Swift.RawRepresentable.rawValue.getter : A.RawValue

Undefined symbol: _swift_allocObject

Undefined symbol: associated conformance descriptor for Foundation._BridgedStoredNSError.Code: Foundation._ErrorCodeProtocol

Undefined symbol: base conformance descriptor for Foundation._ErrorCodeProtocol: Swift.Equatable

Undefined symbol: static Swift._SetStorage.resize(original: Swift.__RawSetStorage, capacity: Swift.Int, move: Swift.Bool) -> Swift._SetStorage<A>

Undefined symbol: static (extension in Foundation):Swift.Set._unconditionallyBridgeFromObjectiveC(__C.NSSet?) -> Swift.Set<A>

Undefined symbol: associated type descriptor for Code

Undefined symbol: Swift.ELEMENT_TYPE_OF_SET_VIOLATES_HASHABLE_REQUIREMENTS(Any.Type) -> Swift.Never

Undefined symbol: method descriptor for Swift.Hashable.hash(into: inout Swift.Hasher) -> ()

Undefined symbol: associated conformance descriptor for Swift.ExpressibleByExtendedGraphemeClusterLiteral.ExtendedGraphemeClusterLiteralType: Swift._ExpressibleByBuiltinExtendedGraphemeClusterLiteral

Undefined symbol: Swift.Hasher._finalize() -> Swift.Int

なんのこっちゃと思いググったら、あった。

参考サイト:https://github.com/mxcl/PromiseKit/issues/1059
m(_ _)m

この手順どおりに、作ったプロジェクトファイル内に、swiftファイルをただ作る。

そして作る際に、「Create Bridging Header」を選択

下記のように空のswiftファイルが追加されていればOK

ビルドしてみると、、、、!通った!

あっぱれ!

obective-c(iPhone)にて、UITabBar毎にUINavigationBarのページをコードで用意する。

最近iphoneアプリの開発をメインでやっており、色々調べながらやっているのですが、
どれもインターフェースビルダーや、ストーリーボードを使った説明が多く個人的にはやりずらい印象をもっております。

と言う事で、色々探した結果、コードでUITabbarUINavigationBarを共存させる方法が見つからなかったので、自力でとりあえず動いた方法を下記にメモします。
余力があればgithubにあげたいと思います。

AppDelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

    _window= [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    _tabBarController = [[UITabBarController alloc] init];  //tabbarコントローラ初期化

    // TabBarControllerに加える3つのViewController
    UIViewController *firstViewController = [[FirstViewController alloc] init];
    UIViewController *secondViewController = [[SecondViewController alloc] init];
    UIViewController *thirdViewController = [[ThirdViewController alloc] init];

    //first用UINavigationController のルート画面 
    UINavigationController *naviFirstViewController = [[UINavigationController alloc] initWithRootViewController:scanViewController];

    //UINavigationController のルート画面 
    UINavigationController *naviSecondListController = [[UINavigationController alloc] initWithRootViewController:secondViewController];

    // tab bar controller の初期化
    self.tabBarController.viewControllers =[NSArray arrayWithObjects:naviFirstViewController, naviSecondListController, thirdViewController, nil];

    [self.window addSubview:self.tabBarController.view];
    [self.window makeKeyAndVisible];

    return YES;
}

上記は、左から2つ目までのタブはそれぞれ、ナビゲーションバーをもっていて、それを最後にタブバーにセットしています。

やっぱりコードで書いた方が、何をやっているかしっくりくるし、
IBXibもあわせてみる必要がなく大変扱いやすいです。

(iOS)objective-c 共通で使える変数 Singletonまとめ

久しぶりの投稿!

objective-cを最近さわりはじめて、どうしても共通で利用したいグローバル変数的なものがほしかったので、色々しらべて見ました!
せっかく自分でメモリ管理できるobjective-cなので、一度作ったメモリをいろんなクラスから利用できたらなということで、参考になったサイトを下記にまとめました。

http://d.hatena.ne.jp/koichirohonda/20120325

http://blog.syuhari.jp/archives/2178

http://ylb.jp/iOSDev/SingletonSample.pdf