Search Results

Search found 657 results on 27 pages for 'nsurl'.

Page 7/27 | < Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >

  • Why are my "tel:" links not working

    - by Griffo
    I have a tableView which has cells with phone numbers. The app is not dialing the numbers though. See the code below - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if (indexPath.section == 2) { UITableViewCell *selectedCell = [tableView cellForRowAtIndexPath:indexPath]; NSString *numberToDial = [NSString stringWithFormat:@"tel:%@", selectedCell.detailTextLabel.text]; NSLog(@"%@",numberToDial); [[UIApplication sharedApplication] openURL:[NSURL URLWithString:numberToDial]]; } } Console ouput: 2010-03-08 01:32:30.830 AIB[1217:207] tel:01 8350098 As you can see, the number goes to the console, but doesn't get dialled. The weird thing is, if I change the last statement to this: [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"tel:171"]]; the phone dials the number 171 without any issue

    Read the article

  • Anti-aliasing not working when resizing a UIWebView

    - by nickcartwright
    I'd like to add a Web View to my app at 60% scale (like seen in Safari in the browse other windows view): Notice how the content looks nice and Aliased! If I try and add the same Web view to my app: NSURL *url = [NSURL URLWithString:@"http://www.google.co.uk?q=hello"]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; UIWebView *webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, 320, 400)]; webView.delegate=self; [webView loadRequest:request]; [self.view addSubview:webView]; Using the following transformation: [webView setTransform:CGAffineTransformMakeScale(0.6, 0.6)]; ..the scale is really bad quality and there appears to be no anti-aliasing. Does anyone know why this is happening or have a suggestion on how it could be fixed? Thanks! Nick.

    Read the article

  • nsstring - out of scope

    - by alexeyndru
    -(void)loadWebAdress:(NSString*)textAdress { [UIApplication sharedApplication].networkActivityIndicatorVisible = YES; adressurl=[NSString stringWithFormat:@"http://%@", textAdress]; NSURL *url=[NSURL URLWithString:adressurl]; NSURLRequest *requestObj=[NSURLRequest requestWithURL:url]; [webview loadRequest:requestObj]; } although url takes it's value from adressurl, adressurl is all the time out of scope when checked in debugger. what is going on? i would like to use it in some other places too. not only in this method. because is out of scope, the app crashes. But, I repeat, it is the one who gives its value to url.

    Read the article

  • passing user from UITableView to UIWebView based on selection

    - by ct2k7
    Hello, I'm trying to pass the user on to the interface based on their cell selection in the UITableView, ie, if the user selects cell 1, they are taken to view model 2, containing UIWebView. UIWebView then displays local file, cell1.html. Currently, I've manage to get placeholder using: selectedCellText.text = selectedCell; to display the name of the cell selected. How do I get it to directly pass to the UIWebView, stick UIWebView in the interface and link it using: UIWebView *myWebView = [[UIWebView alloc] initWithFrame:frame]; NSBundle *mainBundle = [NSBundle mainBundle]; NSString *stringUrl = [mainBundle pathForResource:@"selectedCell" ofType:@"html"]; NSURL *baseUrl = [NSURL fileURLWithPath:stringUrl]; NSURLRequest *urlRequest = [NSURLRequest requestWithURL:baseUrl]; [myWebView loadRequest:urlRequest]; My other issue is that some of the cell names have spaces in them, and for simplicity, I'd like to ensure that there are no spaces (actually, will it even work with spaces in the name, I assume with %20 ? Thanks

    Read the article

  • webViewDidFinishLoad exception

    - by Nava Carmon
    Hi, I have a screen with a webView in my navigation controller stack and when I navigate from this view back to a previous before the page completely loaded I get a EXCEPTION_BAD_ACCESS. Seems, that the view with a webView being released before it comes to webViewDidFinishLoad function. My question is how to overcome this problem? I don't expect from the user to wait till the page loads... The code is very simple: - (void) viewWillAppear:(BOOL)animated { [super viewWillAppear:animated]; NSURL *url = [NSURL URLWithString:storeUrl]; //URL Requst Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //Load the request in the UIWebView. [browser loadRequest:requestObj]; } TIA

    Read the article

  • take images from a cell , into next view controller

    - by richard Stephenson
    hi guys , i asked this question yesterday but it doesnt seem to have asked properly so im trying again in my app im parsing in an xml file , in that file there is a path for an image to download an in my tableview controler i have this to download the image and display it in the cell NSURL *url = [NSURL URLWithString:aStory.picture]; NSData *data = [NSData dataWithContentsOfURL:url]; UIImage *img = [[UIImage alloc] initWithData:data]; im then pushing another view controller on the top and displaying some text in a text view , but i also want to take the image from the cell selected and put that in there too , but everything i try does not work. any ideas on how i can do this Thanks in advance Richard

    Read the article

  • How do I display a local html file in a UIWebView?

    - by Thomas
    I have a relatively simple question that I cannot seem to find the answer for. While doing the Google Maps Java API Tutorials, I ran into a problem. I can load an HTML file from the web, but when I try it locally, it just displays the contents of the file instead of running the script. Here's what works: NSString *url = @"http://code.google.com/apis/maps/documentation/v3/examples/geocoding-simple.html"; NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; [webView loadRequest:request]; I want to store the HTML file locally and run it from the device itself, so I tried: [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"geocoding-simple" ofType:@"html"]isDirectory:NO]]]; and it just displayed the contents of the file. What am I doing wrong here? Thomas

    Read the article

  • Trying to parse twitter trends

    - by timothy5216
    Im trying to parse twitter trends but i keep getting a parser error at "as_of". anyone know why this is happening? EDIT: Here is the code im using NSMutableArray *tweets; tweets = [[NSMutableArray alloc] init]; NSURL *url = [NSURL URLWithString:@"http://search.twitter.com/trends/current.json"]; trendsArray = [[NSMutableArray alloc] initWithArray:[CCJSONParser objectFromJSON:[NSString stringWithContentsOfURL:url encoding:4 error:nil]]]; NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; for (int i = 0; i < [trendsArray count]; i++) { dict = [[NSMutableDictionary alloc] init]; //[post setObject: [[currentArray objectAtIndex:i] objectForKey:@"query"]]; [dict setObject:[trendsArray objectAtIndex:i] forKey:@"trends"]; //[dict setObject:[trendsArray objectAtIndex:i] forKey:@"query"]; //[post setObject:[trendsArray objectAtIndex:i] forKey:@"as_of"]; [tweets addObject:dict]; //post = nil; }

    Read the article

  • loading and formating the rtf file in uiwebview

    - by Jayshree
    Hello everybody. I am trying to load the contents of a rtf file in the uiwebview. I am successful in loading the contents, but it is unformatted. the fonts are too large and it doesnt have any format. it displays the color of the rtf content, but not the font or size. So what should i do now. is there anyother way to load the rtf and format it???? I load the rtf in following way: NSString *path = [[NSBundle mainBundle] pathForResource:@"Home" ofType:@"rtf"]; NSURL *url=[NSURL fileURLWithPath:path]; NSURLRequest *req=[NSURLRequest requestWithURL:url]; [menuWeb loadRequest:req]; So what should i do now. can anybody help me????

    Read the article

  • iPhone Development: Get images from RSS feed

    - by Matthew Saeger
    I am using the NSXMLParser to get new RSS stories from a feed and am displaying them in a UITableView. However now I want to take ONLY the images, and display them in a UIScrollView/UIImageView (3 images side-by side). I am completely lost. I am using the following code to obtain 1 image from a URL. NSURL *theUrl1=[NSURL URLWithString:@"http://farm3.static.flickr.com/2586/4072164719_0fa5695f59.jpg"]; JImage *photoImage1=[[JImage alloc] init]; [photoImage1 setContentMode:UIViewContentModeScaleAspectFill]; [photoImage1 setFrame:CGRectMake(0, 0, 320, 170)]; [photoImage1 initWithImageAtURL:theUrl1]; [imageView1 addSubview:photoImage1]; [photoImage1 release]; This is all I have accomplished, and it works, for one image, and I have to specify the exact URL. What would you recommend I do to accomplish this?

    Read the article

  • i cannot see movie playing in iphone simulator

    - by Neelam Roy
    Hi, i have created a application that plays movie on button click..my application is running without any warning or error. But i am not able to see the movie don't know why? I have added the Media player framework and also imported the #import in viewController.h my button action code is as follow... -(IBAction)playMyMovie:(id)sender{ NSBundle *bundle =[NSBundle mainBundle]; NSString *moviePath = [bundle pathForResource:@"jumps" ofType:@"mov"]; NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain]; MPMoviePlayerController *theMovie =[[MPMoviePlayerController alloc] initWithContentURL:movieURL]; theMovie.scalingMode = MPMovieScalingModeAspectFill; [theMovie play]; } Please tell me what i am missing..

    Read the article

  • How can get image from a path in to UITAbleViewCell ?

    - by srikanth rongali
    I have the following path in NSString *path1, /Users/srikanth/Library/Application Support/iPhone Simulator/User/Applications/9E6E8B22-C946-4442-9209-75BB0E924434/Documents/snook.jpg How can I show the image snook.jpg. I need it to show in UITableViewCell for cell.imageView.image if path1 has the path. I used the following to get the last part of the path1 , snook.jpg. NSURL *url = [NSURL URLWithString:path1]; NSString *imageString = [url path]; But, url is showing as nil. How can I do it ? Thank you.

    Read the article

  • Handling credit cards and IOS

    - by Susan Jackie
    I am using NSUrlConnection asyncronous request to transmit credit card information to a secure third party server. I do the following: I get the credit card number, cvv, etc from the uitextfields. Encode the credit card information into a json format. Set as httpd body of the nsurlconnection request as follows: NSURL * url = [[NSURL URLWithString: "https://www.example.com"]; NSMutableURLRequest * request = [[NSMutableURLRequest alloc] initWithURL: url]; [request setHTTPMethod: @"POST"]; [request setValue:@"application/json" forHTTPHeaderField:@"Accept"]; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; [request setHTTPBody: [NSJSONSerialization dataWithJSONObject: params options: kNilOptions error: &parseError]]; Send this information via asynchronous request to a secure third party server: [NSURLConnection sendAsynchronousRequest:request queue: queue completionHandler:^(NSURLResponse *response, NSData *data, NSError * requestError) { What should I be considering to send user credit card information to a third party server using nsurlconnection asynchronous request?

    Read the article

  • iPhone Google Maps KML Search

    - by satyam
    I'm using Google maps with KML Query. But my query string is "Japanese" string "??????" I'm using http://maps.google.co.jp. When requesting data, I'm getting "0" bytes. But the same query when I put in browser, its download a KML file. My code is as follows: query = [NSString stringWithFormat:@"http://maps.google.co.jp/maps?&near=%f,%f&q=??????&output=kml&num=%d", lat,lon, num]; NSURL* url = [NSURL URLWithString:query]; NSURLRequest* request = [NSURLRequest requestWithURL:url]; NSLog(@"Quering URL = %@", url); NSHTTPURLResponse *response = [[NSHTTPURLResponse alloc] autorelease]; NSData *myData = [NSURLConnection sendSynchronousRequest:request returningResponse: &response error: nil ]; NSInteger errorcode = [response statusCode]; I'm receiving "myData" with 0 bytes. why?

    Read the article

  • ASIHTTP: addOperation when other threads are running

    - by user262325
    Hello everyone I have a project using ASIHTTP to multi download files from a site when I add a new request: [networkQueue cancelAllOperations]; [networkQueue setDownloadProgressDelegate:a]; [networkQueue setDelegate:self]; [networkQueue setRequestDidFinishSelector:@selector(requestDone:)]; NSURL *url = [NSURL URLWithString:@"http://www.google.com"]; ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; [request setDelegate:self]; [request startAsynchronous]; [networkQueue addOperation:request]; [networkQueue go]; it reported: * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[ASINetworkQueue addOperation:]: operation is executing and cannot be enqueued' It looks like I can not add a new request when others are running. Welcome any comment Thanks interdev

    Read the article

  • How do I make my NSNotification trigger a selector?

    - by marty
    Here's the code: - (void)viewDidLoad { [super viewDidLoad]; NSURL *musicURL = [NSURL URLWithString:@"http://live-three2.dmd2.ch/buureradio/buureradio.m3u"]; if([musicURL scheme]) { MPMoviePlayerController *mp = [[MPMoviePlayerController alloc] initWithContentURL:musicURL]; if (mp) { // save the music player object self.musicPlayer = mp; [mp release]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(popBack:) name:@"MPMoviePlayerDidExitFullscreenNotification" object:nil]; // Play the music! [self.musicPlayer play]; } } } -(void)popBack:(NSNotification *)note { [self.navigationController popToRootViewControllerAnimated:YES]; } The selector method never gets called. I just want to pop back to the root menu when the "Done" button is pressed on the movie player. I put an NSLog in the selector to check if it was even being called, nothing. The music plays fine. Any thoughts?

    Read the article

  • Novocaine - How to loop file playback? (iOS)

    - by lppier
    I'm using Novocaine by alexbw Novocaine for my audio project. I'm playing around with the example code here for file reading. The file plays back with no problem. I would like to loop this recording with the gap between the loops - any suggestion as to how I can do so? Thanks. Pier. // AUDIO FILE READING OHHH YEAHHHH // ======================================== NSArray *pathComponents = [NSArray arrayWithObjects: [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject], @"testrecording.wav", nil]; NSURL *inputFileURL = [NSURL fileURLWithPathComponents:pathComponents]; NSLog(@"URL: %@", inputFileURL); fileReader = [[AudioFileReader alloc] initWithAudioFileURL:inputFileURL samplingRate:audioManager.samplingRate numChannels:audioManager.numOutputChannels]; [fileReader play]; [fileReader setCurrentTime:0.0]; //float duration = fileReader.getDuration; [audioManager setOutputBlock:^(float *data, UInt32 numFrames, UInt32 numChannels) { [fileReader retrieveFreshAudio:data numFrames:numFrames numChannels:numChannels]; NSLog(@"Time: %f", [fileReader getCurrentTime]); }];

    Read the article

  • Compiler warning when passing NSError ** as a method parameter

    - by splicer
    I've been scratching my head about this for the last 4 hours, trying out all kinds of little experiments, but I can't seem to figure out what's going wrong. Could this be a compiler bug? Test.m: - (id)initWithContentsOfURL:(NSURL *)aURL error:(NSError **)error { if (!(self = [super init])) { return nil; } return self; } main.m: NSError *error; Test *t = [[Test alloc] initWithContentsOfURL:[NSURL fileURLWithPath:@"/"] error:&error]; Here's the compiler warning (from main.m): warning: incompatible Objective-C types 'struct NSError **', expected 'struct NSDictionary **' when passing argument 2 of 'initWithContentsOfURL:error:' from distinct Objective-C type I'm using the latest versions of Xcode and Snow Leopard.

    Read the article

  • "Cannot find executable for CFBundle/CFPlugIn" error

    - by Emil
    Cannot find executable for CFBundle/CFPlugIn 0x432bfa0 </Library/Audio/Plug-Ins/HAL/DVCPROHDAudio.plugin> (not loaded) Cannot find function pointer NewPlugIn for factory C5A4CE5B-0BB8-11D8-9D75-0003939615B6 in CFBundle/CFPlugIn 0x432bfa0 </Library/Audio/Plug-Ins/HAL/DVCPROHDAudio.plugin> (not loaded) That's the error I get when I try to run this code: NSString *path = [[NSBundle mainBundle] pathForResource:[arraySubFarts objectAtIndex:indexPath.row] ofType:@"mp3"]; NSURL *file = [[NSURL alloc] initFileURLWithPath:path]; AVAudioPlayer *player = [[AVAudioPlayer alloc] initWithContentsOfURL:file error:nil]; self.player = player; [player prepareToPlay]; [player setDelegate:self]; [self.player play]; Any idea why? :S I have included the needed frameworks, and the code works great, the only thing is this odd Console-message..

    Read the article

  • EXC_BAD_ACCESS on startAsynchronous request using ASIFormDataRequest

    - by user280556
    I am getting EXC_BAD_ACCESS on the Line: [asiUsernameRequest startAsynchronous]; in this code. Spent hours trying to figure it out, but no solution. Any idea? NSString *usernameValue = (NSString*)usernameField.text; NSLog(@"username selected: %@", usernameValue); NSURL *url = [NSURL URLWithString:@"http://www.mywebsite.com/api/usernameCheck"]; //ASIHTTPRequest *request = [ASIHTTPRequest requestWithURL:url]; asiUsernameRequest = [[[ASIFormDataRequest alloc] initWithURL:url] retain]; [asiUsernameRequest setPostValue:usernameValue forKey:@"username"]; NSArray *objects = [NSArray arrayWithObjects:@"usernameCheck", nil]; NSArray *keys = [NSArray arrayWithObjects:@"action", nil]; asiUsernameRequest.userInfo = [NSDictionary dictionaryWithObjects:objects forKeys:keys]; [asiUsernameRequest setDelegate:self]; [asiUsernameRequest startAsynchronous];

    Read the article

  • iphone calls both if and else at the same time?

    - by David Schiefer
    Hi, I need to determine what file type a file is and then perform a certain action for it. this seems to work fine for some types, however all media types such as videos and sound files get mixed up. I determine the file type by doing this: BOOL matchedMP3 = ([[rowValue pathExtension] isEqualToString:@"mp3"]); if (matchedMP3 == YES) { NSLog(@"Matched MP3"); } I do this for various file types and just define an "else" for all the others. Here's the problem though. The iPhone calls them both. Here's what the log reveals: 2010-05-11 18:51:12.421 Test [5113:207] Matched MP3 2010-05-11 18:51:12.449 Test [5113:207] Matched ELSE I've never seen anything like this before. This is my "matchedMP3" function: BOOL matchedMP3 = ([[rowValue pathExtension] isEqualToString:@"mp3"]); if (matchedMP3 == YES) { NSLog(@"Matched MP3"); NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *manager = [NSFileManager defaultManager]; self.directoryContent = [manager directoryContentsAtPath:documentsDirectory]; NSString *errorMessage = [documentsDirectory stringByAppendingString:@"/"]; NSString *urlAddress = [errorMessage stringByAppendingString:rowValue]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:urlAddress]]; moviePlayer.movieControlMode = MPMovieControlModeDefault; moviePlayer.backgroundColor = [UIColor blackColor]; [moviePlayer play]; } and here's the else statement: else { NSLog(@"Matched ELSE"); [[NSUserDefaults standardUserDefaults] setObject:rowValue forKey:@"rowValue"]; NSString*rowValue = [[NSUserDefaults standardUserDefaults] objectForKey:@"rowValue"]; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *documentsDirectory = [paths objectAtIndex:0]; NSFileManager *manager = [NSFileManager defaultManager]; self.directoryContent = [manager directoryContentsAtPath:documentsDirectory]; NSString *errorMessage = [documentsDirectory stringByAppendingString:@"/"]; NSString *urlAddress = [errorMessage stringByAppendingString:rowValue]; webViewHeader.prompt = rowValue; [documentViewer setDelegate:self]; NSString *encodedString = [urlAddress stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]; //Create a URL object. NSURL *url = [NSURL URLWithString:encodedString]; //URL Requst Object NSURLRequest *requestObj = [NSURLRequest requestWithURL:url]; //Load the request in the UIWebView. [documentViewer loadRequest:requestObj]; [navigationController pushViewController:webView animated:YES]; } I can't see a reason why it wouldn't work. What happens is that both the webview and the MediaPlayer toggle their own player, so they overlap and play their sound/video a few secs apart from each other. Any help would be appreciated & thank for you taking the time to read through my code.

    Read the article

  • Load remote csv into CHCSVParser

    - by Matt
    Hey guys. I'm using Dave DeLong's CHCSVParser to parse a csv. I can parse the csv locally, but I cannot get it load a remote csv file. I have been staring at my MacBook way too long today and the answer is right in front of me. Here's my code: NSString *urlStr = [[NSString alloc] initWithFormat:@"http://www.somewhere.com/LunchSpecials.csv"]; NSURL *lunchFileURL = [NSURL URLWithString:urlStr]; NSStringEncoding encoding = 0; CHCSVParser *p = [[CHCSVParser alloc] initWithContentsOfCSVFile:[lunchFileURL path] usedEncoding:&encoding error:nil]; [p setParserDelegate:self]; [p parse]; [p release]; Thanks for any help that someone can give me.

    Read the article

  • My iPhone App doesn't work in iOS 4. Why?

    - by noflipes
    Hi everybody. I make a iPhone App that display some videos, I made it with Xcode 3.2.2 with iPhone SDK 3.1.3 and works fine. But a few days ago I downloaded the last version of the iPhone SDK for iOS 4, the proyect Build ok, no erros, no warnings, but when I run the aplication the video didn't work, the image didn't load but sound works. I don't understand it. Here is the code that I used. NSBundle *Bundle = [NSBundle mainBundle]; NSString *moviePath = [Bundle pathForResource:@"Prueba" ofType:@"mp4"]; NSURL *movieURL = [[NSURL fileURLWithPath:moviePath] retain]; MPMoviePlayerController *theMovie = [[MPMoviePlayerController alloc] initWithContentURL:movieURL]; theMovie.scalingMode = MPMovieScalingModeFill; [theMovie play]; Some idea? Best regards

    Read the article

  • Why release the NSURLConnection instance in this statement?

    - by aquaibm
    I read this in a book. -(IBAction) updateTweets { tweetsView.text = @""; [tweetsData release]; tweetsData = [[NSMutableData alloc] init]; NSURL *url = [NSURL URLWithString:@"http://twitter.com/statuses/public_timeline.xml" ]; NSURLRequest *request = [[NSURLRequest alloc] initWithURL: url]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; [connection release]; [request release]; [activityIndicator startAnimating]; } In this statement,is that correct to release the "connection" instance at that time? After releasing it which means this NSURLConnection instance will be destroyed since it's reference count is 0 ,how are we going to make this connection operation work? THANKS.

    Read the article

  • POSTDATA, ASIHTTPrequest + instapaper

    - by Andrew
    Hi guys, I'm trying to use ASIHTTPRequest to submit links to instapaper (http://www.instapaper.com/api). I'm able to authenticate but I get a 400 response when trying to submit a link, so I'm clearly in need of figuring how to use postdata. Any help appreciated. Sample code attached. Thanks NSURL *url = [NSURL URLWithString:urlInstapaperAddUrl]; ASIHTTPRequest instapaperAuthRequest = [ASIHTTPRequest requestWithURL:url]; [instapaperAuthRequest setDelegate:self]; [instapaperAuthRequest setRequestMethod:@"PUT"]; NSData temp = [[NSData alloc] initWithData:[@"url=http://www.redhat.com" dataUsingEncoding:NSASCIIStringEncoding]]; [instapaperAuthRequest appendPostData:temp]; [instapaperAuthRequest addBasicAuthenticationHeaderWithUsername:@"myusername" andPassword:@"mypassword"]; [instapaperAuthRequest startAsynchronous];

    Read the article

< Previous Page | 3 4 5 6 7 8 9 10 11 12 13 14  | Next Page >