2010-12-19 54 views
0

好的,更新,我現在收到以下錯誤,請幫忙!嘗試使用iphone-twitter設置測試程序。 URLShortener錯誤

Ld的構建/調試-iphonesimulator/Test.app /測試正常I386 坎德拉/用戶/ rahulvarshney /文檔/ newbieC/956Family/956Family/iphone-嘰嘰喳喳/實施例 SETENV MACOSX_DEPLOYMENT_TARGET 10.6 SETENV PATH「/開發人員/平臺/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin「 /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ gcc-4.2 -arch i386 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk -L/Users/rahulvarshney/Documents/newbieC/956Family/956Family/iphone-twitter/Example/build/Debug -iphonesimulator -L/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/usr/lib -F/Users/rahulvarshney/Documents/newbieC/956Family/956Family/iphone-twitter/Ex ample/build/Debug-iphonesimulator -filelist /Users/rahulvarshney/Documents/newbieC/956Family/956Family/iphone-twitter/Example/build/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/i386/Test。 LinkFileList -mmacosx版本分鐘= 10.6 -Xlinker -objc_abi_version -Xlinker 2 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/Foundation.framework/Foundation /開發人員/平臺/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/UIKit/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks /CoreGraphics.framework/CoreGraphics -licucore.A -o /Users/rahulvarshney/Documents/newbieC/956Family/956Family/iphone-twitter/Example/build/Debug-iphonesimulator/Test.app/Test

LD:警告: in/Developer/Platforms/iPho neOS.platform/DeviceSupport/4.0.2 /符號/ usr/lib中/ libicucore.A.dylib,在文件 LD缺少必需i386硬件架構:警告:在/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols /usr/lib/libSystem.dylib,缺少文件 中所需的體系結構i386 ld:in /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/usr/lib/libobjc.A.dylib,缺少必需的體系結構i386在文件 collect2:LD返回1退出狀態 命令/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2失敗,退出代碼1

請任何人。幫幫我!

原貼

您好,我只是試圖運行包含以下API的測試程序: https://github.com/st3fan/iphone-twitter

編譯時我得到這個錯誤:

錯誤:預期' )'之前'URLShortener'

它來自TwitterComposeViewController.m第75行,它是以下行:

- (void) shortener: (URLShortener*) shortener didSucceedWithShortenedURL: (NSURL*) shortenedURL 
{ 
// Replace the first URL in the message. This is terrible code that needs to be replaced with a proper regular expression. 

NSMutableString* message = [NSMutableString string]; 

for (NSString* word in [_message componentsSeparatedByCharactersInSet: [NSCharacterSet whitespaceCharacterSet]]) { 
    if ([word hasPrefix: @"http://"] || [word hasPrefix: @"https://"]) { 
    [message appendString: @" "]; 
    [message appendString: [shortenedURL absoluteString]]; 
    } else { 
    [message appendString: @" "]; 
    [message appendString: word]; 
    } 
} 

_textView.text = message; 
[self updateCharactersLeftLabel]; 

[self _showComposeForm]; 
[self _hideStatus]; 
} 

我是n00bie,所以提前道歉。任何幫助表示讚賞,

感謝,

拉胡爾

回答

0

我是該代碼的作者。我對此感到抱歉,我需要更新文檔。

你需要做兩件事情:

首先,在你的目標設置定義TWITTER_USE_URLSHORTENER。

然後,下載https://github.com/st3fan/iphone-bitly並在您的項目中包含這些來源。

+0

甜蜜的耶穌!感謝St3fan!我不覺得這樣一個n00bie更多= ^) – 2010-12-19 23:06:02

+0

好吧,我想我明白了。 – 2010-12-20 04:15:33

+0

嗨St3fan,我已經取得了一些進展,並按照你的指示。但是RegexKitLite.m和RegexKitLite.h呢?這些是否也需要添加到項目中? 好吧,我花了一個小時試圖調試這個。這是我的調試器輸出: – 2010-12-20 17:30:29

0

通常當類似的問題這錯誤:預期「)」之前'報告了自己的應用程序,那是因爲我忘了導入某些該.m文件中必需的頭文件。

所以我建議你檢查你的代碼,看看天氣「URLShortener.h」(或類似的東西)是否正確導入或不正確。

+0

感謝diwup!將試試這個,看看它是否有效= ^) – 2010-12-19 18:14:22