【问题标题】:Trying to set up the test program using iphone-twitter. URLShortener error尝试使用 iphone-twitter 设置测试程序。 URLShortener 错误
【发布时间】:2010-12-19 02:33:54
【问题描述】:

好的,更新,我现在收到以下错误,请帮忙!

ld build/Debug-iphonesimulator/Test.app/Test normal i386 cd /Users/rahulvarshney/Documents/newbieC/956Family/956Family/iphone-twitter/Example setenv MACOSX_DEPLOYMENT_TARGET 10.6 setenv PATH "/Developer/Platforms/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/Example/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-version-min=10.6 -Xlinker -objc_abi_version -Xlinker 2 /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/Foundation .framework/Foundation /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/UIKit.framework/UIKit /Dev eloper/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:警告:在 /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/usr/lib/libicucore.A.dylib 中,文件中缺少所需的体系结构 i386 ld:警告:在 /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/usr/lib/libSystem.dylib 中,文件中缺少所需的体系结构 i386 ld:在 /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,所以提前道歉。任何帮助表示赞赏,

谢谢,

拉胡尔

【问题讨论】:

    标签: objective-c xauth


    【解决方案1】:

    我是该代码的作者。很抱歉造成混乱,我需要更新文档。

    你需要做两件事:

    首先,在您的目标设置中定义 TWITTER_USE_URLSHORTENER。

    然后,下载 https://github.com/st3fan/iphone-bitly 并将这些资源包含在您的项目中。

    【讨论】:

    • 亲爱的耶稣!谢谢St3fan!我不再觉得自己像个 n00bie =^)
    • 好吧,我想我明白了。
    • 嗨 St3fan,我已经取得了一些进展,并按照您的指示进行操作。但是 RegexKitLite.m 和 RegexKitLite.h 呢?这些是否也需要添加到项目中?好的,我花了一个小时尝试调试它。这是我的调试器输出:
    【解决方案2】:

    通常当我自己的应用程序中报告像这样的问题 error: expected ')' before ' 时,这是因为我忘记在那个 .m 文件中导入一些必要的头文件。 p>

    所以我建议你检查你的代码,看看天气“URLShortener.h”(或类似的东西)是否正确导入。

    【讨论】:

      猜你喜欢
      • 2013-03-09
      • 2011-02-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多