Tag: ipad

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) { […]

What's the easiest way to animate a line?

I am creating an app that involves animating lines within a workspace over time. My current approach for this is to use code like this in drawRect: CGContextSetStrokeColor(context, black); CGContextBeginPath(context); CGContextMoveToPoint(context, startPoint.x, startPoint.y); CGContextAddLineToPoint(context, finalPoint.x, finalPoint.y); CGContextStrokePath(context); …and then just setting a timer to run every 0.05 seconds to update finalPoint and call setNeedsDisplay. I’m […]

ios: How open Tab Bar controller from ViewController using StoryBoards

I am doing this and want to open Tab bar Controller from Login Page if its first time and if already login then pass the LoginPage and open Tab Bar Controller after Spalsh means if user lands in app fiirst time sequesnce should be like this 1. Splash 2. Login Page 3. On successful Login […]

How to add text field to inputAccessoryView and make the textView first responder

My code: – (void)viewDidLoad { [super viewDidLoad]; CGRect rectFake = CGRectZero; UITextField *fakeField = [[UITextField alloc] initWithFrame:rectFake]; [self.view addSubview:fakeField]; UIView *av = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 0.0, 39.0)]; av.backgroundColor = [UIColor darkGrayColor]; CGRect rect = CGRectMake(200.0, 4.0, 400.0, 31.0); UITextField *textField = [[UITextField alloc] initWithFrame:rect]; textField.borderStyle = UITextBorderStyleRoundedRect; textField.font = [UIFont systemFontOfSize:24.0]; textField.delegate = self; […]

ViewWillAppear not getting called with UISplitViewController

Background & Objective: I have a UISplitViewController based iPad app – till now it supported 4 orientations but now I want to lock it down to only landscape. I changed shouldAutorotateToInterfaceOrientation of the left view controller to support only landscape mode, but this stops its viewWillAppear from getting called. Details: My iPad’s view controllers are […]

Color wheel or color picker in iOS

How can I make a color wheel, color picker, or hue selector in iOS for use on the iPad. Here is an example picture of a color picker similar to what I want. @All Thanks in advance.

Determine if a file is a valid video quickly

What is the fastest way to determine if a file is playable video? I am not concerned with it being corrupt or not but just whether it is a mime-type that should be playable on the iPad. I have played with pushing the file through a NSURL as suggested by another question but that can […]