Welcome to the Three20 forums! Before you dive too deep into things, please read our forum rules.
how to add a ready-to-use project to Three20UI
  • Vote Up0Vote Down sunlitesunlite April 2012
    Posts: 18

    I have a ready-to-use project ( microblog ),I want to add the microblog project to my other project which has Three20 integrated in. From the - (void)clickActionItem {}; function of the three20UI, to call the microblog project.

    And now, I can call the microblog project from my other project, but can't call it from my other project's three20UI.

    For those codes: self.window.rootViewController = self.sinaWeiBoSDKDemoViewController; [self.window makeKeyAndVisible];

    I get errors: "request for member 'window' in something not a structure or union"

    Would you please tell me how to do it?

    thanks!

  • 4 Comments sorted by
  • Vote Up0Vote Down sunlitesunlite April 2012
    Posts: 18

    when I change - (void)clickActionItem {} in the three20UI as follows: - (void)clickActionItem { SinaWeiBoSDKDemoViewController *sinaWeiBoSDKDemoViewController = [[[SinaWeiBoSDKDemoViewController alloc] initWithNibName:@"SinaWeiBoSDKDemoViewController" bundle:nil] autorelease]; [self.navigationController pushViewController:sinaWeiBoSDKDemoViewController animated:YES]; } Sinaweibo interface appears with oAuth and xAuth. but when click oAuth, my App crashed. When click xAuth, the login interface appears with username and password input text box, but when input them, my app also crashed.Pls help! thanks

  • Vote Up0Vote Down sunlitesunlite April 2012
    Posts: 18

    I got the following errors from the debugger console: [Session started at 2012-04-06 02:42:08 +0000.] 2012-04-06 10:42:21.656 TTNavigatorDemo[461:ef03] Current page in photo browser (1 of 10) 2012-04-06 10:42:23.635 TTNavigatorDemo[461:ef03] -[NSCFString URLEncodedString]: unrecognized selector sent to instance 0x1171e0 2012-04-06 10:42:23.638 TTNavigatorDemo[461:ef03] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSCFString URLEncodedString]: unrecognized selector sent to instance 0x1171e0' *** Call stack at first throw: ( 0 CoreFoundation 0x015875a9 exceptionPreprocess + 185 1 libobjc.A.dylib 0x016db313 objc_exception_throw + 44 2 CoreFoundation 0x015890bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187 3 CoreFoundation 0x014f8966 forwarding + 966 4 CoreFoundation 0x014f8522 _CF_forwarding_prep_0 + 50 5 TTNavigatorDemo 0x000bf4de +[WBRequest stringFromDictionary:] + 438 6 TTNavigatorDemo 0x000c05ad +[WBRequest serializeURL:params:httpMethod:] + 192 7 TTNavigatorDemo 0x000ba3db -[WBAuthorize startAuthorize] + 249 8 TTNavigatorDemo 0x000bd238 -[WBEngine logIn] + 592 9 TTNavigatorDemo 0x000c770d -[SinaWeiBoSDKDemoViewController onLogInOAuthButtonPressed] + 53 10 UIKit 0x004ab4fd -[UIApplication sendAction:to:from:forEvent:] + 119 11 UIKit 0x0053b799 -[UIControl sendAction:to:forEvent:] + 67 12 UIKit 0x0053dc2b -[UIControl(Internal) _sendActionsForEvents:withEvent:] + 527 13 UIKit 0x0053c7d8 -[UIControl touchesEnded:withEvent:] + 458 14 UIKit 0x004cfded -[UIWindow _sendTouchesForEvent:] + 567 15 UIKit 0x004b0c37 -[UIApplication sendEvent:] + 447 16 UIKit 0x004b5f2e _UIApplicationHandleEvent + 7576 17 GraphicsServices 0x01e53992 PurpleEventCallback + 1550 18 CoreFoundation 0x01568944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 52 19 CoreFoundation 0x014c8cf7 __CFRunLoopDoSource1 + 215 20 CoreFoundation 0x014c5f83 __CFRunLoopRun + 979 21 CoreFoundation 0x014c5840 CFRunLoopRunSpecific + 208 22 CoreFoundation 0x014c5761 CFRunLoopRunInMode + 97 23 GraphicsServices 0x01e521c4 GSEventRunModal + 217 24 GraphicsServices 0x01e52289 GSEventRun + 115 25 UIKit 0x004b9c93 UIApplicationMain + 1160 26 TTNavigatorDemo 0x000028de main + 104 27 TTNavigatorDemo 0x0000286d start + 53 ) terminate called throwing an exception

  • Vote Up0Vote Down sunlitesunlite April 2012
    Posts: 18

    I find the defination of URLEncodedString. But still can't work. It is defined in the WBUtil.m ( which is already included in the Three20UI ) as :

    • (NSString *)URLEncodedString { return [self URLEncodedStringWithCFStringEncoding:kCFStringEncodingUTF8]; } ----------------- WBUtil.m

    import "WBUtil.h"

    import <CommonCrypto/CommonDigest.h>

    import <CommonCrypto/CommonHMAC.h>

    import "GTMBase64.h"

    pragma mark - NSData (WBEncode)

    @implementation NSData (WBEncode)

    • (NSString *)MD5EncodedString { unsigned char result[CC_MD5_DIGEST_LENGTH]; CC_MD5([self bytes], [self length], result);
    return [NSString stringWithFormat:@"%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X%02X", result[0], result[1], result[2], result[3], result[4], result[5], result[6], result[7], result[8], result[9], result[10], result[11], result[12], result[13], result[14], result[15]]; }
    • (NSData *)HMACSHA1EncodedDataWithKey:(NSString *)key {
      NSData *keyData = [key dataUsingEncoding:NSUTF8StringEncoding]; void *buffer = malloc(CC_SHA1_DIGEST_LENGTH); CCHmac(kCCHmacAlgSHA1, [keyData bytes], [keyData length], [self bytes], [self length], buffer);
    NSData *encodedData = [NSData dataWithBytesNoCopy:buffer length:CC_SHA1_DIGEST_LENGTH freeWhenDone:YES]; return encodedData; }
    • (NSString *)base64EncodedString { return [GTMBase64 stringByEncodingData:self]; }
    @end

    pragma mark - NSString (WBEncode)

    @implementation NSString (WBEncode)

    • (NSString *)MD5EncodedString { return [[self dataUsingEncoding:NSUTF8StringEncoding] MD5EncodedString]; }

    • (NSData *)HMACSHA1EncodedDataWithKey:(NSString *)key { return [[self dataUsingEncoding:NSUTF8StringEncoding] HMACSHA1EncodedDataWithKey:key]; }

    • (NSString *) base64EncodedString { return [[self dataUsingEncoding:NSUTF8StringEncoding] base64EncodedString]; }

    • (NSString *)URLEncodedString { return [self URLEncodedStringWithCFStringEncoding:kCFStringEncodingUTF8]; }

    • (NSString )URLEncodedStringWithCFStringEncoding:(CFStringEncoding)encoding { return [(NSString *) CFURLCreateStringByAddingPercentEscapes(NULL, (CFStringRef)[[self mutableCopy] autorelease], NULL, CFSTR("=,!$&'()+;@?\n\"<>#\t :/"), encoding) autorelease]; }

    @end

    pragma mark - NSString (WBUtil)

    @implementation NSString (WBUtil)

    • (NSString *)GUIDString { CFUUIDRef theUUID = CFUUIDCreate(NULL); CFStringRef string = CFUUIDCreateString(NULL, theUUID); CFRelease(theUUID); return [(NSString *)string autorelease]; }
    @end

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with Twitter

Sign In Apply for Membership

In this Discussion

Tagged

Latest Three20 version: 1.0.5

Who's Online (1)