Science
fileName = @”mydata.json”; NSString *path = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:fileName]; NSData *data = [NSData dataWithContentsOfFile:path]; if (data) { NSString *jsonStr = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; NSLog(@”REPLY: %@”, jsonStr); } Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post
Continue reading about How To Read a File From Your Application Bundle
Did you ever wonder what the meaning is between a ‘-’ or a ‘+’ to the left of a method ? for instance: – (void)loadInfoFile; versus + (void)loadInfoFile; The first is a regular method and the second is a class method. In plain English, you do not need to instantiate an object of the second [...]
Pagar los recibos usando la cámara del iPhone como aplicación ya es posible en La Caixa. La descarga ya está disponible de forma gratuita en la AppStore y en CaixaMóvil Store, la tienda de aplicaciones para móviles de la caja catalana. La Caixa ha lanzado una nueva aplicación específica para el pago de recibos. Esta [...]
Continue reading about Cómo usar la cámara del iPhone para pagar recibos
If you are wondering why, it is because I believe JSON is a much better data exchange protocol than XML. A few libraries I use for JSON return NSDictionary and NSArray back to you as the result of a parse. In JSON there is no need to write complex parsers (that you will probably just [...]
Continue reading about Simple XML to NSDictionary Converter (like in JSON)
UIImage *cellImage = [UIImage imageNamed:@"Image.png"]; [cell.imageView setImage:tableImage]; CGSize imageSize = CGSizeMake(45,55); UIGraphicsBeginImageContext(imageSize); CGRect imageRect = CGRectMake(1.0, 1.0, imageSize.width, imageSize.height); [cellImage drawInRect:imageRect]; cell.imageView.image = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post
UILabel *legalLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, 300, 120)]; legalLabel.lineBreakMode = UILineBreakModeWordWrap; legalLabel.numberOfLines = 0; //legalLabel.textAlignment = UITextAlignmentCenter; legalLabel.textColor = [UIColor whiteColor]; legalLabel.backgroundColor = [UIColor blackColor]; legalLabel.font = [UIFont fontWithName:@"Arial Rounded MT Bold" size:(14.0)]; legalLabel.text = NSLocalizedString(@”legal_disclaimer”,@”"); [self.view addSubview:legalLabel]; Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet [...]
