Objective c 正在尝试使用iphone twitter设置测试程序。URLShortener错误

Objective c 正在尝试使用iphone twitter设置测试程序。URLShortener错误,objective-c,xauth,Objective C,Xauth,好的,更新,我现在收到以下错误,请帮助 Ld build/Debug iphonesimulator/Test.app/Test normal i386 cd/Users/rahulvarshney/Documents/newbieC/956Family/956Family/iphonetwitter/Example setenv MACOSX_部署_目标10.6 setenv PATH“/Developer/Platforms/iPhoneSimulator.platform/Develope

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

Ld build/Debug iphonesimulator/Test.app/Test normal i386 cd/Users/rahulvarshney/Documents/newbieC/956Family/956Family/iphonetwitter/Example setenv MACOSX_部署_目标10.6 setenv PATH“/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/bin:/usr/sbin:/sbin” /开发者/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/newbic/956Family/iphonetwitter/Example/build/Debug iPhoneSimulator-L/Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/usr/lib-F/Users/rahulvarshney/Documents/newbieC/956Family/956Family/iphonetwitter/Example/build/Debug iphonesimulator-filelist/Users/rahulvarshney/Documents/newbieC/956Family/956Family/iphonetwitter/Example/build/Test.build/Debug-iphonesimulator/Test.build/Objects-normal/i386/Test.LinkFileList-mmacosx version min=10.6-Xlinker-objc\u abi\u version-Xlinker 2/开发者/平台/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/开发者/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator4.1.sdk/System/Library/Frameworks/CoreGraphics.framework/CoreGraphics-licucore.A-o/Users/rahulvarshney/Documents/newbec/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: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中包含的测试程序:

我在编译时遇到此错误:

错误:“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,所以请提前道歉。感谢您的帮助

谢谢


Rahul

通常在我自己的应用程序中报告类似以下错误:expected')‘before’的问题时,这是因为我忘记在该.m文件中导入一些必要的头文件


因此,我建议您检查代码,看看“URLShortener.h”(或类似的东西)是否正确导入。

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

你需要做两件事:

首先,在目标设置中定义TWITTER\u USE\u URLSHORTENER


然后,下载这些资源并将其包含在您的项目中。

亲爱的耶稣!谢谢St3fan!我觉得自己不再是这样一个n00bie了好吧,我想我已经明白了。嗨,St3fan,我已经取得了一些进展,并且按照你的指示做了。但是RegexKitLite.m和RegexKitLite.h呢?这些是否也需要添加到项目中?好的,我花了一个小时试着调试这个。以下是我的调试器输出: