Trying to set up the test program using iphone
Okay, UPDATE, I am now receiving the following errors, please help!
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 /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: warning: in /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/usr/lib/libicucore.A.dylib, missing required architecture i386 in file ld: warning: in /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/usr/lib/libSystem.dylib, missing required architecture i386 in file ld: in /Developer/Platforms/iPhoneOS.platform/DeviceSupport/4.0.2/Symbols/usr/lib/libobjc.A.dylib, missing required architecture i386 in file collect2: ld returned 1 exit status Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
Please anyone. HELP!
Original Post
Hello, I am simply trying to run the test program included in the following API: https://github.com/st3fan/iphone-twitter
I get this error when compiling:
error: expected ')' before 'URLShortener'
It's from TwitterComposeViewController.m line 75, which is the following line:
- (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];
}
I'm a n00bie, so apologies in advance. Any help is appreciated,
Thanks,
Rahul
I'm the author of that code. I'm sorry for the confusion, I need to update the documentation.
You need to do two things:
First, define TWITTER_USE_URLSHORTENER in your target settings.
Then, download https://github.com/st3fan/iphone-bitly and include those sources in your project.
Usually when problems like this error: expected ')' before ' were reported in my own app, it's because I forgot to import some of the necessary header files in that .m file.
So I suggest you check your code and see weather "URLShortener.h" (or something like that) were imported properly or not.
链接地址: http://www.djcxy.com/p/52444.html上一篇: iOS 4.3 Beta 2版本问题
下一篇: 尝试使用iphone设置测试程序