This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
NSString *cssPath = nil ; | |
//set the css path for iPad and iphone | |
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) { | |
cssPath = [[NSBundle mainBundle] pathForResource:@"style" ofType:@"css"]; | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)uploadButtonPressed:(id)sender { | |
NSMutableDictionary *variables = [NSMutableDictionary dictionaryWithCapacity:2]; | |
//create a UIImage (you could use the picture album or camera too) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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] ; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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:"); | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-(IBAction)doDelete | |
{ | |
NSMutableArray *rowsToBeDeleted = [[NSMutableArray alloc] init]; | |
NSMutableArray *indexPaths = [[NSMutableArray alloc] init]; | |
int index = 0; | |
for (NSNumber *rowSelected in selectedSongs) | |
{ | |
if ([rowSelected boolValue]) | |
{ | |
NewerOlder