Tag: ipad

Using transparent background color in UIView by HTML code

I’m trying to display an ad in UIView… I need to set the background color to transparent… I tried using, [viewObject setBackgroundColor:[UIColor clearcolor]]; Eventhough it made the UIView transparent, it is displaying white background… Below is the HTML code I tried… NSString *HTML = [NSString stringWithFormat:@”<html><head><meta name=\”viewport\” content=\”width=device-width, user-scalable=no\”/><style>*{margin:0px;padding:0px}</style> </head><body style=\” background-color:transparent\”><div style=\”text-align: %@\”>%@</div></body></html>”,adAlignment,link]; Thanks […]

UISplitViewController – Multiple Detail View Controllers via storyboard segues

I’m trying to do a project for the iPad in which I’d like to utilized the split view controller. I’ll be having different detail view controllers for each of the cells in the master view controller. I saw one solution how to do this via storyboard segues in this site. He basically linked each of […]

how to pass data through @selector upon custom button click?

I’m making a button via code. I have the following line of code to trigger a method when the button is clicked: [imagesButton addTarget:self action:@selector(photoClicked:) forControlEvents:UIControlEventTouchDown ]; The problem is that I can’t pass data to the method through the @selector; If the button had a background image name “background.png” how would I go about […]

how to detect blow from mic not voice in iphone?

i’m using this code to detect blow. but i cant get the blow. i got voice. NSURL *url = [NSURL fileURLWithPath:@”/dev/null”]; NSDictionary *settings = [NSDictionary dictionaryWithObjectsAndKeys: [NSNumber numberWithFloat: 44100.0], AVSampleRateKey, [NSNumber numberWithInt: kAudioFormatAppleLossless], AVFormatIDKey, [NSNumber numberWithInt: 1], AVNumberOfChannelsKey, [NSNumber numberWithInt: AVAudioQualityMax], AVEncoderAudioQualityKey, nil]; NSError *error; recorder = [[AVAudioRecorder alloc] initWithURL:url settings:settings error:&error]; if (recorder) { […]

Problem building project with Google Analytics lib in XCode 4

My project is a universal iPhone/iPad app and it was all working fine in the previous version of XCode. I just upgraded and now when I try to build for the device (it works in the simulator), I get this build error: Google Analytics SDK/Library/libGoogleAnalytics.a, file is universal but does not contain a(n) armv7 slice […]

How to set first page in UIPageViewController

When the user is on the first page of a UIPageViewController and tries to go back, I simply return nil. In iOS 5 this works fine. It is causing a crash in iOS 6. *** Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘The number of view controllers provided (0) doesn’t match the number required […]

How do you detect when a file is changed in iCloud?

When a file is changed in iCloud (whether added, deleted, or the content changed), I would like to call a method I created ([self methodName]) so that I can update my table view with the names of the new files. How am I notified of the file change? Do I need to listen for a […]

download iphone sample code from apple

the iphone sdk documentation has links to sample code, but you have to download them individually from the web. Is there a bundle you can download all at once from apple ? For example, reading the first iphone tutorial at switchonthecode, the first new word I came across was UIApplication. There are 5 samples on […]

Why .jpeg file save via writetofile using UIImageJPEGRepresentation method have large size then UIImageWriteToSavedPhotosAlbum in ios

I am trying to save an UIImage object to an .jpeg file in device and I am using this code: -(void)saveImageToDocumentsDirectory:(UIImage *)mimage withFileName:(NSString *)fileName { UIImageWriteToSavedPhotosAlbum(mimage,nil,nil,nil); NSData *dataForJPEGFile = UIImageJPEGRepresentation(mimage, 1.0); NSError *error2 = nil; if (![dataForJPEGFile writeToFile:[self getDirectoryFilePath:fileName] options:NSAtomicWrite error:&error2]) { return; } } It will save the image of .jpeg type but take […]

Error message when migrating Core Data store

The Problem: I’ve got some pretty simple code (below) that causes an exception during ‘migratePersistentStore‘ with the error message Exception:*** -[__NSArrayM replaceObjectAtIndex:withObject:]: object cannot be nil The Code: NSPersistentStore * oldStore = [_persistentStoreCoordinator persistentStores][0]; if (oldStore) { @try { [_persistentStoreCoordinator migratePersistentStore:oldStore toURL:[self storeURL] options: @{ NSPersistentStoreRemoveUbiquitousMetadataOption : @YES } withType:NSSQLiteStoreType error:&error]; } @catch(NSException* ex) { […]