Skip to content

Instantly share code, notes, and snippets.

NSString *cssPath = nil ;
//set the css path for iPad and iphone
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
cssPath = [[NSBundle mainBundle] pathForResource:@"style" ofType:@"css"];
}
- (IBAction)uploadButtonPressed:(id)sender {
NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:2];
//create a UIImage (you could use the picture album or camera too)
Me: God, can I ask You a question?
God: Sure
Me: Promise You won't get mad
... ... ... ...
God: I promise
Me: Why did You let so much stuff happen to me today?
- (void)save
{
if ([titleText.text isEqualToString:@""]) {
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Info" message:@"Title Must Be There"
delegate:self cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[alertView show];
[alertView release];
//remove html tags
- (NSString *)flattenHTML:(NSString *)html {
NSScanner *theScanner;
NSString *text = nil;
theScanner = [NSScanner scannerWithString:html];
while ([theScanner isAtEnd] == NO) {
// find start of tag
[theScanner scanUpToString:@"<" intoString:NULL] ;
// find end of tag
[theScanner scanUpToString:@">" intoString:&text] ;
//get first name ,last name and phone numbers list
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person property:(ABPropertyID)property identifier:(ABMultiValueIdentifier)identifier
{
//first name string
NSString* name = (NSString *)ABRecordCopyValue(person,
kABPersonFirstNameProperty);
// firstNameLabel.text = name;
- (void)tableView:(UITableView *)atableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
activityIndicator.hidden = NO;
[activityIndicator startAnimating];
NSString *selectedSong = [NSString stringWithFormat:@"%@",[songsList objectAtIndex:indexPath.row]];
NSLog(@"selected Song %@",selectedSong);
[atableView deselectRowAtIndexPath:indexPath animated:YES];
if (InEditMode)
- (void)getPlayList
{
NSFileManager *fileManager = [NSFileManager defaultManager];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documents = [paths objectAtIndex:0];
NSError *error = nil;
NSArray *documentsDirectorySongs = [fileManager contentsOfDirectoryAtPath:documents error:&error];
NSUInteger playListCount = [documentsDirectorySongs count];
NSLog(@"%u",playListCount);
[UIView animateWithDuration:1.0f
animations:^{
playerTwoImage.center = boardView.center;
// Here you can disable the game play so that while animation is in progress, player cannot do other operations like rotating the dice, etc...
}
completion:^(BOOL finished){
if(finished) {
NSLog(@"Player2 moved to square:");
-(IBAction)doDelete
{
NSMutableArray *rowsToBeDeleted = [[NSMutableArray alloc] init];
NSMutableArray *indexPaths = [[NSMutableArray alloc] init];
int index = 0;
for (NSNumber *rowSelected in selectedSongs)
{
if ([rowSelected boolValue])
{