2014-08-31 68 views
1

我已將TokBox框架包含在我的項目中,因此我們可以執行視頻短信。問題在於框架以及他們需要的其他框架不會讓您在模擬器中編譯或運行應用程序;他們不支持。如何在編譯到模擬器時排除Xcode中的框架

有沒有辦法在編譯到模擬器時設置編譯器標誌以跳過TokBox和其他框架?原因是我需要在iPhone 4,4s 5,5s和9月9日發佈的任何設備上測試我們的應用程序。我不擁有每種類型的手機之一。

收到此錯誤:

file was built for archive which is not the architecture being linked (i386) 

我加入這個我的其他連接標誌爲「任何iPhone模擬器SKD」,但仍然未能

"-ObjC -framework MobileCoreServices -framework SystemConfiguration -framework OpenTok" 

回答

1

以下是解決這個問題的步驟。

使構建階段>鏈接二進制代碼庫成爲可選的OpenTok框架而不是必需的。

您可能需要從Project Navigator中刪除OpenTok框架並鏈接Binary With Libraries,然後清理然後添加回來並使其成爲可選項。

在Build Settings> Linking in「Other Linker Flags」中,您應該有一個Debug and Release。 在調試中引用打開的談話,你需要做這樣的事情的所有類增加一個新的選擇「在任何iOS模擬器SDK」右側類型此-weak_framework OpenTok

enter image description here

然後。

#if TARGET_IPHONE_SIMULATOR 
@interface TokBoxVideoViewController(){ 
NSMutableDictionary *allStreams; 
NSMutableDictionary *allSubscribers; 
NSMutableArray *allConnectionsIds; 

OTSession *_session; 
OTPublisher *_publisher; 
OTSubscriber *_currentSubscriber; 
CGPoint _startPosition; 

BOOL initialized; 
} 
#else 
@interface TokBoxVideoViewController()<OTSessionDelegate, OTSubscriberKitDelegate, 
OTPublisherDelegate>{ 
    NSMutableDictionary *allStreams; 
    NSMutableDictionary *allSubscribers; 
    NSMutableArray *allConnectionsIds; 

    OTSession *_session; 
    OTPublisher *_publisher; 
    OTSubscriber *_currentSubscriber; 
    CGPoint _startPosition; 

    BOOL initialized; 
} 
#endif