- (void)viewDidLoad {

[self.textField setReturnKeyType:UIReturnKeyDone];
[self.textField addTarget:self
action:@selector(textFieldFinished:)
forControlEvents:UIControlEventEditingDidEndOnExit];

}

- (IBAction)textFieldFinished:(id)sender {
[sender resignFirstResponder];
}

- (void)viewDidLoad {
[txtInput addTarget:self action:@selector(onTextFieldDidChange) forControlEvents:UIControlEventEditingChanged];
}

-(void)onTextFieldDidChange {
NSLog(@” – txtInput = %@”,txtInput.text);
}

UITextView *questionText = [ [UITextView alloc ] initWithFrame:CGRectMake(5.0, 5.0, 300.0, 50.0) ];
questionText.textAlignment = UITextAlignmentLeft;
questionText.editable = NO;
questionText.scrollEnabled = NO;
questionText.textColor = [UIColor blackColor];
questionText.backgroundColor = [UIColor whiteColor];
questionText.font = [UIFont fontWithName:@"Helvetica" size:(12.0)];
[scrollView addSubview:questionText];
questionText.text = @"Appropriately parallel task next-generation applications through fully tested architectures. Uniquely coordinate professional outsourcing via fully tested mindshare";
[questionText release];

-(void)manageImageDirectories {

NSFileManager *filemgr = [NSFileManager defaultManager];
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDir = [documentPaths objectAtIndex:0];

NSString *ocFullDirPath = [NSString stringWithFormat:@"%@/OrangeCounty", documentsDir];

if ( ![filemgr fileExistsAtPath:ocFullDirPath isDirectory:YES] ) {
[filemgr createDirectoryAtPath:ocFullDirPath withIntermediateDirectories:NO attributes:nil error:nil];
}

}

-(BOOL)imageExists:(NSString*)imageName inThisDirectory:(NSString*)dirName {

NSFileManager *filemgr = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);

// the documents directory plus whatever is in dirName then imageName
NSString *documentsDirectory = [NSString stringWithFormat:@"%@/%@",[paths objectAtIndex:0], dirName];

if ([filemgr fileExistsAtPath: [documentsDirectory stringByAppendingPathComponent:imageName] ] == YES) {

return YES;

} else {

return NO;

}

}

Jul 122011

$protocol = strtolower(substr($_SERVER["SERVER_PROTOCOL"],0,5))=='https'?'https':'http';
print "The protocol is $protocol";
?>

taken directly from:

http://readytousesolutions.com/phpblog/php-tutorial-get-protocol/

Split a string into an array of strings by using NSString's componentsSeparatedByString:

NSString *myString = @"This is a test";
NSArray *myWords = [myString componentsSeparatedByString:@" "];

// myWords is now: [@"This", @"is", @"a", @"test"]
If you need to split on a set of several different characters, use NSString's componentsSeparatedByCharactersInSet:

NSString *myString = @"Foo-bar/blee";
NSArray *myWords = [myString componentsSeparatedByCharactersInSet:
[NSCharacterSet characterSetWithCharactersInString:@"-/"]
];

// myWords is now: [@"Foo", @"bar", @"blee"]

http://www.idev101.com/code/Objective-C/Strings/split.html


// toggle the I have accepted all your terms and conditions button
-(IBAction)actHasAccepted:(id)sender {
buttonHasAccepted.selected = !buttonHasAccepted.selected;
}

// the button that should trigger whatever
-(IBAction) doSomethingIfUserAgrees:(id) sender {

//
if (!buttonHasAccepted.selected) {

UIAlertView *alert =
[[UIAlertView alloc] initWithTitle: @"Error"
message: @"You must agree copy"
delegate: self
cancelButtonTitle: @"OK"
otherButtonTitles: nil];
[alert show];
[alert release];

} else {

// Carry on

}

}

[datePicker setDate:[NSDate date] animated:YES];

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData*)data {
NSLog(@"EWYFPicOneViewController - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData*)data {");
NSString *string = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding];
NSLog(@" data == %@",string);

}

© 2012 James Border Suffusion theme by Sayontan Sinha