2010-12-19 65 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