2011-12-20 20 views
5

Mentre MGTwitterEngine funziona bene su versioni precedenti di iOS, non è riuscito con EXC_BAD_ACCESS al momento in cui si tenta di inviare twit:MGTwitterEngine incidente in iOS5

[twitter sendUpdate:textToShare]; 

L'ultimo elenco di codice Objective-C esecutore è:

[theRequest prepare]; 

all'interno di SA_OAuthTwitterEngine.m. Questo è lo stack delle chiamate:

#1 0x00045a63 in -[OAMutableURLRequest URLEncodedString:] at /Users/ben/Dropbox/Dev/External Projects/Twitter-OAuth-iPhone/OAuthConsumeriPhoneLib/OAuthConsumerSrc/OAMutableURLRequest.m:287 
#2 0x000445fa in -[OAMutableURLRequest prepare] at /Users/ben/Dropbox/Dev/External Projects/Twitter-OAuth-iPhone/OAuthConsumeriPhoneLib/OAuthConsumerSrc/OAMutableURLRequest.m:131 
#3 0x00041778 in -[SA_OAuthTwitterEngine _sendRequestWithMethod:path:queryParameters:body:requestType:responseType:] at /Developer/WorkShop/XDictionary/trunk/Dictionary/Twitter+OAuth/SAOAuthTwitterEngine/SA_OAuthTwitterEngine.m:325 
#4 0x000356b1 in -[MGTwitterEngine sendUpdate:inReplyTo:] at /Developer/WorkShop/XDictionary/trunk/Dictionary/Twitter+OAuth/MGTwitterEngine/MGTwitterEngine.m:1037 
#5 0x0003546c in -[MGTwitterEngine sendUpdate:]() 
#6 0x00023ae7 in -[SocialNetworking twitterShare]() 
#7 0x00023c2b in -[SocialNetworking OAuthTwitterController:authenticatedWithUsername:]() 
#8 0x0003d0d5 in -[SA_OAuthTwitterController gotPin:]() 
#9 0x0003eabb in -[SA_OAuthTwitterController webViewDidFinishLoad:]() 
#10 0x0051736a in -[UIWebView webView:didFinishLoadForFrame:]() 
#11 0x00518956 in -[UIWebViewWebViewDelegate webView:didFinishLoadForFrame:]() 
#12 0x01ced51d in __invoking___() 
#13 0x01ced437 in -[NSInvocation invoke]() 
#14 0x01d1849a in -[NSInvocation invokeWithTarget:]() 
#15 0x04f09aff in -[_WebSafeForwarder forwardInvocation:]() 
#16 0x01cee0c9 in ___forwarding___() 
#17 0x01cedce2 in __forwarding_prep_0___() 
#18 0x01ced51d in __invoking___() 
#19 0x01ced437 in -[NSInvocation invoke]() 
#20 0x05aa9ae3 in SendMessage(NSInvocation*)() 
#21 0x05aaa115 in HandleDelegateSource(void*)() 
#22 0x01d5b97f in __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__() 
#23 0x01cbeb73 in __CFRunLoopDoSources0() 
#24 0x01cbe454 in __CFRunLoopRun() 
#25 0x01cbddb4 in CFRunLoopRunSpecific() 
#26 0x01cbdccb in CFRunLoopRunInMode() 
#27 0x02ee1879 in GSEventRunModal() 
#28 0x02ee193e in GSEventRun() 
#29 0x00360a9b in UIApplicationMain() 
#30 0x00001d3a in main() 

Qualche idea? Soluzione? Conosci un altro framework di Twitter che funziona bene con iOS 5? L'unica cosa che devo fare con esso - post twits (con accesso possibile prima, ovviamente).

risposta

15
- (SA_OAuthTwitterEngine *) initOAuthWithDelegate: (NSObject *) delegate { 
    if (self = (id) [super initWithDelegate: delegate]) { 
     self.requestTokenURL = [NSURL URLWithString: @"https://twitter.com/oauth/request_token"]; 
     self.accessTokenURL = [NSURL URLWithString: @"https://twitter.com/oauth/access_token"]; 
     self.authorizeURL = [NSURL URLWithString: @"https://twitter.com/oauth/authorize"]; 
    } 
    return self; 
} 

Modificare la funzione SA_OAuthTwitterEngine.m come descritto sopra. Fondamentalmente devi aggiornare gli URL oAuth su https. Qualcosa in iOS5 impedisce di reindirizzamento a HTTPS da http

+2

+1 grazie amico mi ha aiutato – Saawan

1

aggiungere bandiera -all_load in configurazione Regolazione

https://developer.apple.com/library/mac/#qa/qa2006/qa1490.html

-all_load costringe il linker per caricare tutti i file oggetto da ogni archiviarlo vede, anche quelli senza Codice Objective-C. -force_load è disponibile in Xcode 3.2 e versioni successive. Permette un controllo più fine dei grani del caricamento degli archivi. Ogni opzione -force_load deve essere seguita da un percorso per un archivio e ogni file oggetto in quell'archivio verrà caricato.