Search Results

Search found 4 results on 1 pages for 'xcodedev'.

Page 1/1 | 1 

  • How To Read A Remote Text File

    - by XcodeDev
    Hi, I would like to read a remote text file called posts.txt on my website. An example of the insides of the posts.txt file would be this: <div style="width : 300px; position : relative"><font face="helvetica, geneva, sans serif" size="6"><b>2</b></font><font face="helvetica, geneva, sans serif" size="4"><i> scored by iSDK</i></font><br><img src="Bar.png" /></div><div style="width : 300px; position : relative"><font face="helvetica, geneva, sans serif" size="6"><b>2</b></font><font face="helvetica, geneva, sans serif" size="4"><i> scored by martin</i></font><br><img src="Bar.png" /></div> What I wanted to know is how can I get the score, and scored by text from the .txt file? The score is (in this case) the: <b>2</b>, and the scored by text in this case would be: "scored by iSDK". Any code telling me how to do this is twice as helpful! Thanks in advanced XcodeDev

    Read the article

  • Getting random objects from an array, and if the objects are the same, get a new object.

    - by XcodeDev
    Hi, I have made a jokes application, where the user generates a joke and the joke will display in a UILabel. However I am trying to randomise the jokes show, but I do not want to show the same joke twice. Please could you tell me how I could do this. I am using the code below to try and do that, but it seems that it is not working. - (IBAction)generateNewJoke { if (i < [jokeArray count]) { i++; [userDefaults setInteger:[userDefaults integerForKey:kNewIndex] forKey:kOldIndex]; int oldnumber = [userDefaults integerForKey:kOldIndex]; int newnumber = [userDefaults integerForKey:kNewIndex]; [answerLabel setText:@""]; [userDefaults setInteger:i forKey:kNewIndex]; if (oldnumber == newnumber) { NSLog(@"they are the same"); [userDefaults setInteger:arc4random()%[jokeArray count] forKey:kNewIndex]; } [jokeLabel setText:[jokeArray objectAtIndex:[userDefaults integerForKey:kNewIndex]]]; } }

    Read the article

  • TextField Covering UIAlertView's Button.

    - by XcodeDev
    Hi, I am using a UIAlertView with three buttons: "Dismiss", "Submit Score" and @"View Leaderboard". The UIAlertView also contains a UITextField called username. At the moment the UITextField "username" is covering one of the buttons in the UIAlertView. I just wanted to know how I could stop the UITextField from covering one of the buttons, i.e move the buttons down. Here is an image of what is happening: And here is my code: [username setBackgroundColor:[UIColor whiteColor]]; [username setBorderStyle:UITextBorderStyleRoundRect]; username.backgroundColor = [UIColor clearColor]; username.returnKeyType = UIReturnKeyDone; username.keyboardAppearance = UIKeyboardAppearanceAlert; username.placeholder = @"Enter your name here"; username = [[UITextField alloc] initWithFrame:CGRectMake(20.0, 45.0, 245.0, 25.0)]; username.borderStyle = UITextBorderStyleRoundedRect; [username resignFirstResponder]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Congratulations" message:[NSString stringWithFormat:@"You tapped %i times in %i seconds!\n", tapAmount, originalCountdownTime] delegate:self cancelButtonTitle:@"Dismiss" otherButtonTitles:@"Submit To High Score Leaderboard", @"View Leaderboard", nil]; alert.tag = 01; [alert addSubview:username]; [alert show]; [alert release];

    Read the article

  • Help Redirecting A Page to Another Page with adverts for 5 seconds, and then redirecting to another page.

    - by XcodeDev
    Hey, I am trying to redirect a page to another page, and that was working successfully. However I am trying to redirect the first page to another page with adverts. This page will then redirect to another page after five seconds. I am trying to do that by doing this: <?php include('ads.php'); ?> <?php sleep(2); $url = $_GET['url']; header("Location: ".$url.""); exit; ?> However it is showing the advert in ads.php perfectly, but it is not redirecting after five seconds. I am receiving this error in my web browser: Warning: Cannot modify header information - headers already sent by (output started at /home/nucleusi/public_html/adverts/ads.php:1) in /home/nucleusi/public_html/adverts/index.php on line 7 A typical link I would be redirecting to would be this: http://nucleusiphone.com/adverts/index.php/?url=http%3A%2F%2Fitunes.apple.com%2Fmx%2Falbum%2Fstill-got-the-blues%2Fid14135178%3Fi%3D14135158 Thanks in advanced. PS. I don't know any php so any code helps!

    Read the article

1