Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @synthesize datiLista,aggiornare,caricaTesto,Lista,webView,oggetto,ricetta_Aggiunta,Archivio_commenti;
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- // Do any additional setup after loading the view.
- NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://**************.altervista.org/feed/"]];
- [RSSParser parseRSSFeedForRequest:req success:^(NSArray *feedItems) {
- [self setDatiLista:feedItems];
- oggetto= [datiLista objectAtIndex:0];
- NSLog(@"%@",oggetto.titolo); //object full
- } failure:^(NSError *error) {
- NSLog(@"Error: %@",error);
- }];
- NSLog(@"%@",oggetto.titolo); // object empty
- vedi_commenti = [[ViewController_Laterale alloc]initWithNibName:nil bundle:nil];
- vedi_Internet = [[Vista_Stato_Internet alloc]initWithNibName:nil bundle:nil];
- webView= [[UIWebView alloc]initWithFrame:CGRectMake(0, 0, 320, 570)];
- [webView setDelegate:self];
- if( UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone ){
- NSString *htmlString =[NSString stringWithFormat:@"<html> n"
- "<head> n"
- "<style type="text/css"> n"
- "body {font-family: "%@"; font-size: %@;color: #808080;}n"
- "</style> n"
- "</head> n"
- // "<center><img src='%@'/ alt='' style='max-width:250px;'></center>" //immagine
- "<center><h2>%@</h2></center>n" //titolo
- "<center><body>%@</body></center></html>" ,@"futura",[NSNumber numberWithInt:50],@"futura",[NSNumber numberWithInt:45],oggetto.titolo,oggetto.contenuto_Intero];
- [webView setScalesPageToFit:YES];
- [webView loadHTMLString:htmlString baseURL:nil];
- [self.view addSubview:webView];
- [webView addSubview:aggiornare];
- [webView addSubview:caricaTesto];
- }
- -(void)ricaricaHome:(id)sender{
- NSLog(@"%@",oggetto.titolo); // object full
- datiLista=nil;
- NSURLRequest *req = [[NSURLRequest alloc] initWithURL:[NSURL URLWithString:@"http://*********.altervista.org/feed/"]];
- [RSSParser parseRSSFeedForRequest:req success:^(NSArray *feedItems) {
- [self setDatiLista:feedItems];
- oggetto= [datiLista objectAtIndex:0];
- } failure:^(NSError *error) {
- NSLog(@"Error: %@",error);
- }];
- }
- - (void)vista_Commenti:(id)sender {
- NSLog(@"%@",oggetto.titolo); // object full
- NSNumberFormatter *form=[[NSNumberFormatter alloc]init];
- [vedi_commenti mostra_SlideConMessaggio:@"Commenti:" Conteggio:[form stringFromNumber:oggetto.Conteggio_commenti]];
- [self.revealSideViewController pushViewController:vedi_commenti onDirection:PPRevealSideDirectionRight animated:YES];
- }
- -(void)vista_WiFi:(id)sender{
- NSLog(@"%@",oggetto.titolo); // object full
- [self.revealSideViewController pushViewController:vedi_Internet onDirection:PPRevealSideDirectionLeft animated:YES];
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement